home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / etc_-_Configuration_Files / MAGIC < prev    next >
Text File  |  1999-09-17  |  144KB  |  4,183 lines

  1. # Magic file created Mon May 10 08:02:49 CDT 1999 by zap!root     tty2     May 10 07:35
  2. #! file
  3. # Magic data for file(1) command.
  4. # Machine-generated from src/cmd/file/magdir/*; edit there only!
  5. # Format is described in magic(files), where:
  6. # files is 5 on V7 and BSD, 4 on SV, and ?? in the SVID.
  7.  
  8. #------------------------------------------------------------------------------
  9. # Localstuff:  file(1) magic for locally observed files
  10. #
  11. # $Id: Localstuff,v 1.3 1995/01/21 21:09:00 christos Exp $
  12. # Add any locally observed files here.  Remember:
  13. # text if readable, executable if runnable binary, data if unreadable.
  14.  
  15. #------------------------------------------------------------------------------
  16. # alliant:  file(1) magic for Alliant FX series a.out files
  17. #
  18. # If the FX series is the one that had a processor with a 68K-derived
  19. # instruction set, the "short" should probably become "beshort" and the
  20. # "long" should probably become "belong".
  21. # If it's the i860-based one, they should probably become either the
  22. # big-endian or little-endian versions, depending on the mode they ran
  23. # the 860 in....
  24. #
  25. 0    short        0420        0420 Alliant virtual executable
  26. >2    short        &0x0020        common library
  27. >16    long        >0        not stripped
  28. 0    short        0421        0421 Alliant compact executable
  29. >2    short        &0x0020        common library
  30. >16    long        >0        not stripped
  31. #------------------------------------------------------------------------------
  32. # alpha architecture description
  33. #
  34.  
  35. 0    leshort        0603        COFF format alpha
  36. >22    leshort&030000    !020000        executable
  37. >24    leshort        0410        pure
  38. >24    leshort        0413        paged
  39. >22    leshort&020000    !0        dynamically linked
  40. >16    lelong        !0        not stripped
  41. >16    lelong        0        stripped
  42. >22    leshort&030000    020000        shared library
  43. >24    leshort        0407        object
  44. >27    byte        x        - version %d
  45. >26    byte        x        .%d
  46. >28    byte        x        -%d
  47.  
  48. # Basic recognition of Digital UNIX core dumps - Mike Bremford <mike@opac.bl.uk>
  49. #
  50. 0    string        Core\001    Alpha COFF format core dump (Digital UNIX)
  51. >24    string        >\0        \b, from '%s'
  52. #------------------------------------------------------------------------------
  53. # amanda:  file(1) magic for amanda file format
  54. #
  55. 0       string          AMANDA:\ TAPESTART\ DATE     AMANDA dump header file,
  56. >23     string          X
  57. >>25    string          >\                           Unused %s
  58. >23     string          >\                           DATE %s
  59. #------------------------------------------------------------------------------
  60. # amigaos:  file(1) magic for AmigaOS binary formats:
  61.  
  62. #
  63. # From ignatios@cs.uni-bonn.de (Ignatios Souvatzis)
  64. # Some formats are still missing: AmigaOS special IFF's, e.g.: FORM....CTLG
  65. # (the others should be seperate, anyway)
  66. #
  67. 0    belong        0x000003f3    AmigaOS loadseg()ble executable/binary
  68. 0    belong        0x000003e7    AmigaOS object/library data
  69.  
  70. #------------------------------------------------------------------------------
  71. # animation:  file(1) magic for animation/movie formats
  72. #
  73. # animation formats
  74. # MPEG, FLI, DL originally from vax@ccwf.cc.utexas.edu (VaX#n8)
  75. # FLC, SGI, Apple originally from Daniel Quinlan (quinlan@yggdrasil.com)
  76.  
  77. # MPEG animation format
  78. 0    belong        0x000001b3        MPEG video stream data
  79. #>4    beshort&0xfff0    x            (%d x
  80. #>5    beshort&0x0fff  x            %d)
  81. 0    belong        0x000001ba        MPEG system stream data
  82. 0    beshort&0xfff0    0xfff0            MPEG audio stream data
  83.  
  84. # FLI animation format
  85. 4    leshort        0xAF11            FLI file
  86. >6    leshort        x            - %d frames,
  87. >8    leshort        x            width=%d pixels,
  88. >10    leshort        x            height=%d pixels,
  89. >12    leshort        x            depth=%d,
  90. >16    leshort        x            ticks/frame=%d
  91. # FLC animation format
  92. 4    leshort        0xAF12            FLC file
  93. >6    leshort        x            - %d frames
  94. >8    leshort        x            width=%d pixels,
  95. >10    leshort        x            height=%d pixels,
  96. >12    leshort        x            depth=%d,
  97. >16    leshort        x            ticks/frame=%d
  98.  
  99. # DL animation format
  100. # XXX - collision with most `mips' magic
  101. #
  102. # I couldn't find a real magic number for these, however, this
  103. # -appears- to work.  Note that it might catch other files, too, so be
  104. # careful!
  105. #
  106. # Note that title and author appear in the two 20-byte chunks
  107. # at decimal offsets 2 and 22, respectively, but they are XOR'ed with
  108. # 255 (hex FF)!  The DL format is really bad.
  109. #
  110. #0    byte    1    DL version 1, medium format (160x100, 4 images/screen)
  111. #>42    byte    x    - %d screens,
  112. #>43    byte    x    %d commands
  113. #0    byte    2    DL version 2
  114. #>1    byte    1    - large format (320x200,1 image/screen),
  115. #>1    byte    2    - medium format (160x100,4 images/screen),
  116. #>1    byte    >2    - unknown format,
  117. #>42    byte    x    %d screens,
  118. #>43    byte    x    %d commands
  119. # Based on empirical evidence, DL version 3 have several nulls following the
  120. # \003.  Most of them start with non-null values at hex offset 0x34 or so.
  121. #0    string    \3\0\0\0\0\0\0\0\0\0\0\0    DL version 3
  122.  
  123. # SGI and Apple formats
  124. 0    string        MOVI        Silicon Graphics movie file
  125. 4    string        moov        Apple QuickTime movie file (moov)
  126. 4    string        mdat        Apple QuickTime movie file (mdat)
  127.  
  128. #------------------------------------------------------------------------------
  129. # apl:  file(1) magic for APL (see also "pdp" and "vax" for other APL
  130. #       workspaces)
  131. #
  132. 0    long        0100554        APL workspace (Ken's original?)
  133.  
  134. #------------------------------------------------------------------------------
  135. # apple:  file(1) magic for Apple file formats
  136. #
  137. 0    string        FiLeStArTfIlEsTaRt    binscii (apple ][) text
  138. 0    string        \x0aGL            Binary II (apple ][) data
  139. 0    string        \x76\xff        Squeezed (apple ][) data
  140. 0    string        NuFile            NuFile archive (apple ][) data
  141. 0    string        N\xf5F\xe9l\xe5        NuFile archive (apple ][) data
  142. 0    belong        0x00051600        AppleSingle encoded Macintosh file
  143. 0    belong        0x00051607        AppleDouble encoded Macintosh file
  144.  
  145.  
  146. #------------------------------------------------------------------------------
  147. # archive:  file(1) magic for archive formats (see also "msdos" for self-
  148. #           extracting compressed archives)
  149. #
  150. # cpio, ar, arc, arj, hpack, lha/lharc, rar, squish, uc2, zip, zoo, etc.
  151. # pre-POSIX "tar" archives are handled in the C code.
  152.  
  153. # POSIX tar archives
  154. 257    string        ustar\0        POSIX tar archive
  155. 257    string        ustar\040\040\0    GNU tar archive
  156.  
  157. # cpio archives
  158. #
  159. # Yes, the top two "cpio archive" formats *are* supposed to just be "short".
  160. # The idea is to indicate archives produced on machines with the same
  161. # byte order as the machine running "file" with "cpio archive", and
  162. # to indicate archives produced on machines with the opposite byte order
  163. # from the machine running "file" with "byte-swapped cpio archive".
  164. #
  165. # The SVR4 "cpio(4)" hints that there are additional formats, but they
  166. # are defined as "short"s; I think all the new formats are
  167. # character-header formats and thus are strings, not numbers.
  168. 0    short        070707        cpio archive
  169. 0    short        0143561        byte-swapped cpio archive
  170. 0    string        070707        ASCII cpio archive (pre-SVR4 or odc)
  171. 0    string        070701        ASCII cpio archive (SVR4 with no CRC)
  172. 0    string        070702        ASCII cpio archive (SVR4 with CRC)
  173.  
  174. # Debian package (needs to go before regular portable archives)
  175. #
  176. 0    string        !<arch>\ndebian
  177. >8    string        debian-split    part of multipart Debian package
  178. >8    string        debian-binary    Debian binary package
  179. >68    string        >\n        (format %s)
  180. >136    ledate        x        created: %s
  181.  
  182. # other archives
  183. 0    long        0177555        very old archive
  184. 0    short        0177555        very old PDP-11 archive
  185. 0    long        0177545        old archive
  186. 0    short        0177545        old PDP-11 archive
  187. 0    long        0100554        apl workspace
  188. 0    string        =<ar>        archive
  189.  
  190. # MIPS archive (needs to go before regular portable archives)
  191. #
  192. 0    string    !<arch>\n__________E    MIPS archive
  193. >20    string    U            with MIPS Ucode members
  194. >21    string    L            with MIPSEL members
  195. >21    string    B            with MIPSEB members
  196. >19    string    L            and an EL hash table
  197. >19    string    B            and an EB hash table
  198. >22    string    X            -- out of date
  199.  
  200. 0    string        -h-        Software Tools format archive text
  201.  
  202. #
  203. # XXX - why are there multiple <ar> thingies?  Note that 0x213c6172 is
  204. # "!<ar", so, for new-style (4.xBSD/SVR2andup) archives, we have:
  205. #
  206. # 0    string        !<arch>        current ar archive
  207. # 0    long        0x213c6172    archive file
  208. #
  209. # and for SVR1 archives, we have:
  210. #
  211. # 0    string        \<ar>        System V Release 1 ar archive
  212. # 0    string        =<ar>        archive
  213. #
  214. # XXX - did Aegis really store shared libraries, breakpointed modules,
  215. # and absolute code program modules in the same format as new-style
  216. # "ar" archives?
  217. #
  218. 0    string        !<arch>        current ar archive
  219. >8    string        __.SYMDEF    random library
  220. >0    belong        =65538        - pre SR9.5
  221. >0    belong        =65539        - post SR9.5
  222. >0    beshort        2        - object archive
  223. >0    beshort        3        - shared library module
  224. >0    beshort        4        - debug break-pointed module
  225. >0    beshort        5        - absolute code program module
  226. 0    string        \<ar>        System V Release 1 ar archive
  227. 0    string        =<ar>        archive
  228. #
  229. # XXX - from "vax", which appears to collect a bunch of byte-swapped
  230. # thingies, to help you recognize VAX files on big-endian machines;
  231. # with "leshort", "lelong", and "string", that's no longer necessary....
  232. #
  233. 0    belong        0x65ff0000    VAX 3.0 archive
  234. 0    belong        0x3c61723e    VAX 5.0 archive
  235. #
  236. 0    long        0x213c6172    archive file
  237. 0    lelong        0177555        very old VAX archive
  238. 0    leshort        0177555        very old PDP-11 archive
  239. #
  240. # XXX - "pdp" claims that 0177545 can have an __.SYMDEF member and thus
  241. # be a random library (it said 0xff65 rather than 0177545).
  242. #
  243. 0    lelong        0177545        old VAX archive
  244. >8    string        __.SYMDEF    random library
  245. 0    leshort        0177545        old PDP-11 archive
  246. >8    string        __.SYMDEF    random library
  247. #
  248. # From "pdp" (but why a 4-byte quantity?)
  249. #
  250. 0    lelong        0x39bed        PDP-11 old archive
  251. 0    lelong        0x39bee        PDP-11 4.0 archive
  252.  
  253. # ARC archiver, from Daniel Quinlan (quinlan@yggdrasil.com)
  254. #
  255. # The first byte is the magic (0x1a), byte 2 is the compression type for
  256. # the first file (0x01 through 0x09), and bytes 3 to 15 are the MS-DOS
  257. # filename of the first file (null terminated).  Since some types collide
  258. # we only test some types on basis of frequency: 0x08 (83%), 0x09 (5%),
  259. # 0x02 (5%), 0x03 (3%), 0x04 (2%), 0x06 (2%).  0x01 collides with terminfo.
  260. 0    lelong&0x8080ffff    0x0000081a    ARC archive data, dynamic LZW
  261. 0    lelong&0x8080ffff    0x0000091a    ARC archive data, squashed
  262. 0    lelong&0x8080ffff    0x0000021a    ARC archive data, uncompressed
  263. 0    lelong&0x8080ffff    0x0000031a    ARC archive data, packed
  264. 0    lelong&0x8080ffff    0x0000041a    ARC archive data, squeezed
  265. 0    lelong&0x8080ffff    0x0000061a    ARC archive data, crunched
  266.  
  267. # Acorn archive formats (Disaster prone simpleton, m91dps@ecs.ox.ac.uk)
  268. # I can't create either SPARK or ArcFS archives so I have not tested this stuff
  269. # [GRR:  the original entries collide with ARC, above; replaced with combined
  270. #  version (not tested)]
  271. #0    byte        0x1a        RISC OS archive
  272. #>1    string        archive        (ArcFS format)
  273. 0    string        \032archive    RISC OS archive (ArcFS format)
  274.  
  275. # ARJ archiver (jason@jarthur.Claremont.EDU)
  276. 0    leshort        0xea60        ARJ archive data
  277. >5    byte        x        \b, v%d,
  278. >8    byte        &0x04        multi-volume,
  279. >8    byte        &0x10        slash-switched,
  280. >8    byte        &0x20        backup,
  281. >34    string        x        original name: %s,
  282. >7    byte        0        os: MS-DOS
  283. >7    byte        1        os: PRIMOS
  284. >7    byte        2        os: Unix
  285. >7    byte        3        os: Amiga
  286. >7    byte        4        os: Macintosh
  287. >7    byte        5        os: OS/2
  288. >7    byte        6        os: Apple ][ GS
  289. >7    byte        7        os: Atari ST
  290. >7    byte        8        os: NeXT
  291. >7    byte        9        os: VAX/VMS
  292. >3    byte        >0        %d]
  293.  
  294. # HA archiver (Greg Roelofs, newt@uchicago.edu)
  295. # This is a really bad format. A file containing HAWAII will match this...
  296. #0    string        HA        HA archive data,
  297. #>2    leshort        =1        1 file,
  298. #>2    leshort        >1        %u files,
  299. #>4    byte&0x0f    =0        first is type CPY
  300. #>4    byte&0x0f    =1        first is type ASC
  301. #>4    byte&0x0f    =2        first is type HSC
  302. #>4    byte&0x0f    =0x0e        first is type DIR
  303. #>4    byte&0x0f    =0x0f        first is type SPECIAL
  304.  
  305. # HPACK archiver (Peter Gutmann, pgut1@cs.aukuni.ac.nz)
  306. 0    string        HPAK        HPACK archive data
  307.  
  308. # JAM Archive volume format, by Dmitry.Kohmanyuk@UA.net
  309. 0    string        \351,\001JAM\        JAM archive,
  310. >7    string        >\0            version %.4s
  311. >0x26    byte        =0x27            -
  312. >>0x2b    string          >\0            label %.11s,
  313. >>0x27    lelong        x            serial %08x,
  314. >>0x36    string        >\0            fstype %.8s
  315.  
  316. # LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu)
  317. 2    string        -lh0-        LHarc 1.x archive data [lh0]
  318. 2    string        -lh1-        LHarc 1.x archive data [lh1]
  319. 2    string        -lz4-        LHarc 1.x archive data [lz4]
  320. 2    string        -lz5-        LHarc 1.x archive data [lz5]
  321. #    [never seen any but the last; -lh4- reported in comp.compression:]
  322. 2    string        -lzs-        LHa 2.x? archive data [lzs]
  323. 2    string        -lh\40-        LHa 2.x? archive data [lh ]
  324. 2    string        -lhd-        LHa 2.x? archive data [lhd]
  325. 2    string        -lh2-        LHa 2.x? archive data [lh2]
  326. 2    string        -lh3-        LHa 2.x? archive data [lh3]
  327. 2    string        -lh4-        LHa (2.x) archive data [lh4]
  328. 2    string        -lh5-        LHa (2.x) archive data [lh5]
  329. >20    byte        x        - header level %d
  330.  
  331. # RAR archiver (Greg Roelofs, newt@uchicago.edu)
  332. 0    string        Rar!        RAR archive data
  333.  
  334. # SQUISH archiver (Greg Roelofs, newt@uchicago.edu)
  335. 0    string        SQSH        squished archive data (Acorn RISCOS)
  336.  
  337. # UC2 archiver (Greg Roelofs, newt@uchicago.edu)
  338. # I can't figure out the self-extracting form of these buggers...
  339. 0    string        UC2\x1a        UC2 archive data
  340.  
  341. # ZIP archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
  342. 0    string        PK\003\004    Zip archive data
  343. >4    byte        0x09        \b, at least v0.9 to extract
  344. >4    byte        0x0a        \b, at least v1.0 to extract
  345. >4    byte        0x0b        \b, at least v1.1 to extract
  346. >4    byte        0x14        \b, at least v2.0 to extract
  347.  
  348. # Zoo archiver
  349. 20    lelong        0xfdc4a7dc    Zoo archive data
  350. >4    byte        >48        \b, v%c.
  351. >>6    byte        >47        \b%c
  352. >>>7    byte        >47        \b%c
  353. >32    byte        >0        \b, modify: v%d
  354. >>33    byte        x        \b.%d+
  355. >42    lelong        0xfdc4a7dc    \b,
  356. >>70    byte        >0        extract: v%d
  357. >>>71    byte        x        \b.%d+
  358.  
  359. # Shell archives
  360. 10    string        #\ This\ is\ a\ shell\ archive    shell archive text
  361.  
  362. #------------------------------------------------------------------------------
  363. # asterix:  file(1) magic for Aster*x; SunOS 5.5.1 gave the 4-character
  364. # strings as "long" - we assume they're just strings:
  365. # From: guy@netapp.com (Guy Harris)
  366. #
  367. 0    string        *STA        Aster*x
  368. >7    string        WORD            Words Document
  369. >7    string        GRAP            Graphic
  370. >7    string        SPRE            Spreadsheet
  371. >7    string        MACR            Macro
  372. 0    string        2278        Aster*x Version 2
  373. >29    byte        0x36            Words Document
  374. >29    byte        0x35            Graphic
  375. >29    byte        0x32            Spreadsheet
  376. >29    byte        0x38            Macro
  377.  
  378.  
  379. #------------------------------------------------------------------------------
  380. # att3b:  file(1) magic for AT&T 3B machines
  381. #
  382. # The `versions' should be un-commented if they work for you.
  383. # (Was the problem just one of endianness?)
  384. #
  385. # 3B20
  386. #
  387. # The 3B20 conflicts with SCCS.
  388. #0    beshort        0550        3b20 COFF executable
  389. #>12    belong        >0        not stripped
  390. #>22    beshort        >0        - version %ld
  391. #0    beshort        0551        3b20 COFF executable (TV)
  392. #>12    belong        >0        not stripped
  393. #>22    beshort        >0        - version %ld
  394. #
  395. # WE32K
  396. #
  397. 0    beshort        0560        WE32000 COFF
  398. >18    beshort        ^00000020    object
  399. >18    beshort        &00000020    executable
  400. >12    belong        >0        not stripped
  401. >18    beshort        ^00010000    N/A on 3b2/300 w/paging
  402. >18    beshort        &00020000    32100 required
  403. >18    beshort        &00040000    and MAU hardware required
  404. >20    beshort        0407        (impure)
  405. >20    beshort        0410        (pure)
  406. >20    beshort        0413        (demand paged)
  407. >20    beshort        0443        (target shared library)
  408. >22    beshort        >0        - version %ld
  409. 0    beshort        0561        WE32000 COFF executable (TV)
  410. >12    belong        >0        not stripped
  411. #>18    beshort        &00020000    - 32100 required
  412. #>18    beshort        &00040000    and MAU hardware required
  413. #>22    beshort        >0        - version %ld
  414. #
  415. # core file for 3b2 
  416. 0    string        \000\004\036\212\200    3b2 core file
  417. >364    string        >\0        of '%s'
  418.  
  419. #------------------------------------------------------------------------------
  420. # audio:  file(1) magic for sound formats (see also "iff")
  421. #
  422. # Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com),
  423. # and others
  424. #
  425.  
  426. # Sun/NeXT audio data
  427. 0    string        .snd        Sun/NeXT audio data:
  428. >12    belong        1        8-bit ISDN u-law,
  429. >12    belong        2        8-bit linear PCM [REF-PCM],
  430. >12    belong        3        16-bit linear PCM,
  431. >12    belong        4        24-bit linear PCM,
  432. >12    belong        5        32-bit linear PCM,
  433. >12    belong        6        32-bit IEEE floating point,
  434. >12    belong        7        64-bit IEEE floating point,
  435. >12    belong        23        8-bit ISDN u-law compressed (CCITT G.721 ADPCM voice data encoding),
  436. >12    belong        24        compressed (8-bit G.722 ADPCM)
  437. >12    belong        25        compressed (3-bit G.723 ADPCM),
  438. >12    belong        26        compressed (5-bit G.723 ADPCM),
  439. >12    belong        27        8-bit A-law,
  440. >20    belong        1        mono,
  441. >20    belong        2        stereo,
  442. >20    belong        4        quad,
  443. >16    belong        >0        %d Hz
  444.  
  445. # DEC systems (e.g. DECstation 5000) use a variant of the Sun/NeXT format
  446. # that uses little-endian encoding and has a different magic number
  447. 0    lelong        0x0064732E    DEC audio data:
  448. >12    lelong        1        8-bit ISDN u-law,
  449. >12    lelong        2        8-bit linear PCM [REF-PCM],
  450. >12    lelong        3        16-bit linear PCM,
  451. >12    lelong        4        24-bit linear PCM,
  452. >12    lelong        5        32-bit linear PCM,
  453. >12    lelong        6        32-bit IEEE floating point,
  454. >12    lelong        7        64-bit IEEE floating point,
  455. >12    lelong        23        8-bit ISDN u-law compressed (CCITT G.721 ADPCM voice data encoding),
  456. >20    lelong        1        mono,
  457. >20    lelong        2        stereo,
  458. >20    lelong        4        quad,
  459. >16    lelong        >0        %d Hz
  460.  
  461. # Creative Labs AUDIO stuff
  462. 0    string    MThd            Standard MIDI data
  463. >9     byte    >0            (format %d)
  464. >11    byte    >1            using %d channels
  465. 0    string    CTMF            Creative Music (CMF) data
  466. 0    string    SBI            SoundBlaster instrument data
  467. 0    string    Creative\ Voice\ File    Creative Labs voice data
  468. # is this next line right?  it came this way...
  469. >19    byte    0x1A
  470. >23    byte    >0            - version %d
  471. >22    byte    >0            \b.%d
  472.  
  473. # first entry is also the string "NTRK"
  474. 0    belong        0x4e54524b    MultiTrack sound data
  475. >4    belong        x        - version %ld
  476.  
  477. # Microsoft WAVE format (*.wav)
  478. 0    string        RIFF        Microsoft RIFF
  479. >8    string        WAVE        \b, WAVE audio data
  480. >>34    leshort        >0        \b, %d bit
  481. >>22    leshort        =1        \b, mono
  482. >>22    leshort        =2        \b, stereo
  483. >>22    leshort        >2        \b, %d channels
  484. >>24    lelong        >0        %d Hz
  485. # AVI == Audio Video Interleave
  486. >8      string          AVI\            \b, AVI data
  487.  
  488. # Extended MOD format (*.emd) (Greg Roelofs, newt@uchicago.edu); NOT TESTED
  489. # [based on posting 940824 by "Dirk/Elastik", husberg@lehtori.cc.tut.fi]
  490. 0    string        EMOD        Extended MOD sound data,
  491. >4    byte&0xf0    x        version %d
  492. >4    byte&0x0f    x        \b.%d,
  493. >45    byte        x        %d instruments
  494. >83    byte        0        (module)
  495. >83    byte        1        (song)
  496.  
  497. # Real Audio (Magic .ra\0375)
  498. 0    belong        0x2e7261fd    realaudio sound file
  499.  
  500. # MTM/669/FAR/S3M/ULT/XM format checking [Aaron Eppert, aeppert@dialin.ind.net]
  501. # Oct 31, 1995
  502. 0    string        MTM        MultiTracker Module sound file
  503. 0    string        if        Composer 669 Module sound data
  504. 0    string        FAR        Module sound data
  505. 0    string        MAS_U        ULT(imate) Module sound data
  506. 0x2c    string        SCRM        ScreamTracker III Module sound data
  507. 0    string        Extended Module    Extended Module sound data
  508.  
  509. # Gravis UltraSound patches
  510. # From <ache@nagual.ru>
  511.  
  512. 0    string        GF1PATCH110\0ID#000002\0    GUS patch
  513. 0    string        GF1PATCH100\0ID#000002\0    Old GUS    patch
  514.  
  515. #
  516. # Taken from loader code from mikmod version 2.14
  517. # by Steve McIntyre (stevem@chiark.greenend.org.uk)
  518. 0    string    JN        extended 669 module data
  519. 0    string    MAS_UTrack_V00
  520. >14    string    >/0        ultratracker V1.%.1s module sound data
  521. 0    string    UN05        MikMod UNI format module sound data
  522. 0    string    Extended\ Module: Fasttracker II module sound data
  523. 21    string    !SCREAM!    Screamtracker 2 module sound data
  524. 1080    string    M.K.        4-channel Protracker module sound data
  525. 1080    string    M!K!        4-channel Protracker module sound data
  526. 1080    string    FLT4        4-channel Startracker module sound data
  527. 1080    string    4CHN        4-channel Fasttracker module sound data
  528. 1080    string    6CHN        6-channel Fasttracker module sound data
  529. 1080    string    8CHN        8-channel Fasttracker module sound data
  530. 1080    string    CD81        8-channel Oktalyzer module sound data
  531. 1080    string    OKTA        8-channel Oktalyzer module sound data
  532. 1082    string    CH
  533. >1080    string    >/0        %.2s-channel Fasttracker "oktalyzer" module sound data
  534. 1080    string    16CN        16-channel Taketracker module sound data
  535. 1080    string    32CN        32-channel Taketracker module sound data
  536.  
  537. # TOC sound files -Trevor Johnson <trevor@jpj.net>
  538. #
  539. 0       string          TOC             TOC sound file
  540.  
  541. #------------------------------------------------------------------------------
  542. # blit:  file(1) magic for 68K Blit stuff as seen from 680x0 machine
  543. #
  544. # Note that this 0407 conflicts with several other a.out formats...
  545. #
  546. # XXX - should this be redone with "be" and "le", so that it works on
  547. # little-endian machines as well?  If so, what's the deal with
  548. # "VAX-order" and "VAX-order2"?
  549. #
  550. #0    long        0407        68K Blit (standalone) executable
  551. #0    short        0407        VAX-order2 68K Blit (standalone) executable
  552. 0    short        03401        VAX-order 68K Blit (standalone) executable
  553. 0    long        0406        68k Blit mpx/mux executable
  554. 0    short        0406        VAX-order2 68k Blit mpx/mux executable
  555. 0    short        03001        VAX-order 68k Blit mpx/mux executable
  556. # Need more values for WE32 DMD executables.
  557. # Note that 0520 is the same as COFF
  558. #0    short        0520        tty630 layers executable
  559.  
  560. #------------------------------------------------------------------------------
  561. # bsdi:  file(1) magic for BSD/OS (from BSDI) objects
  562. #
  563. 0    lelong            000000314    BSD/OS i386 compact demand paged executable
  564. >16    lelong            >0        not stripped
  565. >32    byte            0x6a        (uses shared libs)
  566.  
  567. #------------------------------------------------------------------------------
  568. # c-lang:  file(1) magic for C programs (or REXX)
  569. #
  570.  
  571. # XPM icons (Greg Roelofs, newt@uchicago.edu)
  572. # if you uncomment "/*" for C/REXX below, also uncomment this entry
  573. #0    string        /*\ XPM\ */    X pixmap image data
  574.  
  575. # this first will upset you if you're a PL/1 shop...
  576. # in which case rm it; ascmagic will catch real C programs
  577. #0    string        /*        C or REXX program text
  578. 0    string        //        C++ program text
  579.  
  580. #------------------------------------------------------------------------------
  581. # chi:  file(1) magic for ChiWriter files
  582. #
  583. 0       string          \\1cw\          ChiWriter file
  584. >5      string          >\0             version %s
  585. 0       string          \\1cw           ChiWriter file
  586. #------------------------------------------------------------------------------
  587. # cisco:  file(1) magic for cisco Systems routers
  588. #
  589. # Most cisco file-formats are covered by the generic elf code
  590. #
  591. # Microcode files are non-ELF, 0x8501 conflicts with NetBSD/alpha.
  592. 0    belong&0xffffff00    0x85011400  cisco IOS microcode
  593. >7    string        >\0            for '%s'
  594. 0    belong&0xffffff00    0x8501cb00  cisco IOS experimental microcode
  595. >7    string        >\0            for '%s'
  596.  
  597. #------------------------------------------------------------------------------
  598. # clipper:  file(1) magic for Intergraph (formerly Fairchild) Clipper.
  599. #
  600. # XXX - what byte order does the Clipper use?
  601. #
  602. # XXX - what's the "!" stuff:
  603. #
  604. # >18    short        !074000,000000    C1 R1 
  605. # >18    short        !074000,004000    C2 R1
  606. # >18    short        !074000,010000    C3 R1
  607. # >18    short        !074000,074000    TEST
  608. #
  609. # I shall assume it's ANDing the field with the first value and
  610. # comparing it with the second, and rewrite it as:
  611. #
  612. # >18    short&074000    000000        C1 R1 
  613. # >18    short&074000    004000        C2 R1
  614. # >18    short&074000    010000        C3 R1
  615. # >18    short&074000    074000        TEST
  616. #
  617. # as SVR3.1's "file" doesn't support anything of the "!074000,000000"
  618. # sort, nor does SunOS 4.x, so either it's something Intergraph added
  619. # in CLIX, or something AT&T added in SVR3.2 or later, or something
  620. # somebody else thought was a good idea; it's not documented in the
  621. # man page for this version of "magic", nor does it appear to be
  622. # implemented (at least not after I blew off the bogus code to turn
  623. # old-style "&"s into new-style "&"s, which just didn't work at all).
  624. #
  625. 0    short        0575        CLIPPER COFF executable (VAX #)
  626. >20    short        0407        (impure)
  627. >20    short        0410        (5.2 compatible)
  628. >20    short        0411        (pure)
  629. >20    short        0413        (demand paged)
  630. >20    short        0443        (target shared library)
  631. >12    long        >0        not stripped
  632. >22    short        >0        - version %ld
  633. 0    short        0577        CLIPPER COFF executable
  634. >18    short&074000    000000        C1 R1 
  635. >18    short&074000    004000        C2 R1
  636. >18    short&074000    010000        C3 R1
  637. >18    short&074000    074000        TEST
  638. >20    short        0407        (impure)
  639. >20    short        0410        (pure)
  640. >20    short        0411        (separate I&D)
  641. >20    short        0413        (paged)
  642. >20    short        0443        (target shared library)
  643. >12    long        >0        not stripped
  644. >22    short        >0        - version %ld
  645. >48    long&01        01        alignment trap enabled
  646. >52    byte        1        -Ctnc
  647. >52    byte        2        -Ctsw
  648. >52    byte        3        -Ctpw
  649. >52    byte        4        -Ctcb
  650. >53    byte        1        -Cdnc
  651. >53    byte        2        -Cdsw
  652. >53    byte        3        -Cdpw
  653. >53    byte        4        -Cdcb
  654. >54    byte        1        -Csnc
  655. >54    byte        2        -Cssw
  656. >54    byte        3        -Cspw
  657. >54    byte        4        -Cscb
  658. 4    string        pipe        CLIPPER instruction trace
  659. 4    string        prof        CLIPPER instruction profile
  660.  
  661. #------------------------------------------------------------------------------
  662. # commands:  file(1) magic for various shells and interpreters
  663. #
  664. 0    string        :\ shell archive or commands for antique kernel text
  665. 0    string        #!/bin/sh        Bourne shell script text
  666. 0    string        #!\ /bin/sh        Bourne shell script text
  667. 0    string        #!\    /bin/sh        Bourne shell script text
  668. 0    string        #!/bin/csh        C shell script text
  669. 0    string        #!\ /bin/csh        C shell script text
  670. 0    string        #!\    /bin/csh    C shell script text
  671. # korn shell magic, sent by George Wu, gwu@clyde.att.com
  672. 0    string        #!/bin/ksh        Korn shell script text
  673. 0    string        #!\ /bin/ksh        Korn shell script text
  674. 0    string        #!\    /bin/ksh    Korn shell script text
  675. 0    string         #!/bin/tcsh        Tenex C shell script text
  676. 0    string         #!\ /bin/tcsh        Tenex C shell script text
  677. 0    string         #!\    /bin/tcsh    Tenex C shell script text
  678. 0    string        #!/usr/local/tcsh    Tenex C shell script text
  679. 0    string         #!\ /usr/local/tcsh    Tenex C shell script text
  680. 0    string        #!/usr/local/bin/tcsh    Tenex C shell script text
  681. 0    string        #!\ /usr/local/bin/tcsh    Tenex C shell script text
  682. 0    string        #!\    /usr/local/bin/tcsh    Tenex C shell script text
  683. #
  684. # zsh/ash/ae/nawk/gawk magic from cameron@cs.unsw.oz.au (Cameron Simpson)
  685. 0    string        #!/usr/local/bin/zsh    Paul Falstad's zsh
  686. 0    string        #!\ /usr/local/bin/zsh    Paul Falstad's zsh
  687. 0    string        #!\    /usr/local/bin/zsh    Paul Falstad's zsh
  688. 0    string        #!/usr/local/bin/ash    Neil Brown's ash
  689. 0    string        #!\ /usr/local/bin/ash    Neil Brown's ash
  690. 0    string        #!\    /usr/local/bin/ash    Neil Brown's ash
  691. 0    string        #!/usr/local/bin/ae    Neil Brown's ae
  692. 0    string        #!\ /usr/local/bin/ae    Neil Brown's ae
  693. 0    string        #!\    /usr/local/bin/ae    Neil Brown's ae
  694. 0    string        #!/bin/nawk        new awk script text
  695. 0    string        #!\ /bin/nawk        new awk script text
  696. 0    string        #!\    /bin/nawk        new awk script text
  697. 0    string        #!/usr/bin/nawk        new awk script text
  698. 0    string        #!\ /usr/bin/nawk    new awk script text
  699. 0    string        #!\    /usr/bin/nawk    new awk script text
  700. 0    string        #!/usr/local/bin/nawk    new awk script text
  701. 0    string        #!\ /usr/local/bin/nawk    new awk script text
  702. 0    string        #!\    /usr/local/bin/nawk    new awk script text
  703. 0    string        #!/bin/gawk        GNU awk script text
  704. 0    string        #!\ /bin/gawk        GNU awk script text
  705. 0    string        #!\    /bin/gawk        GNU awk script text
  706. 0    string        #!/usr/bin/gawk        GNU awk script text
  707. 0    string        #!\ /usr/bin/gawk    GNU awk script text
  708. 0    string        #!\    /usr/bin/gawk    GNU awk script text
  709. 0    string        #!/usr/local/bin/gawk    GNU awk script text
  710. 0    string        #!\ /usr/local/bin/gawk    GNU awk script text
  711. 0    string        #!\    /usr/local/bin/gawk    GNU awk script text
  712. #
  713. 0    string        #!/bin/awk        awk commands text
  714. 0    string        #!\ /bin/awk        awk commands text
  715. 0    string        #!\    /bin/awk        awk commands text
  716. 0    string        #!/usr/bin/awk        awk commands text
  717. 0    string        #!\ /usr/bin/awk    awk commands text
  718. 0    string        #!\    /usr/bin/awk    awk commands text
  719. 0    string        BEGIN            awk commands text
  720.  
  721. # For Larry Wall's perl language.  The ``eval'' line recognizes an
  722. # outrageously clever hack for USG systems.
  723. #                Keith Waclena <keith@cerberus.uchicago.edu>
  724. 0    string        #!/bin/perl            perl commands text
  725. 0    string        #!\ /bin/perl            perl commands text
  726. 0    string        #!\    /bin/perl        perl commands text
  727. 0    string        eval\ "exec\ /bin/perl        perl commands text
  728. 0    string        #!/usr/bin/perl            perl commands text
  729. 0    string        #!\ /usr/bin/perl        perl commands text
  730. 0    string        #!\    /usr/bin/perl        perl commands text
  731. 0    string        eval\ "exec\ /usr/bin/perl    perl commands text
  732. 0    string        #!/usr/local/bin/perl        perl commands text
  733. 0    string        #!\ /usr/local/bin/perl        perl commands text
  734. 0    string        #!\    /usr/local/bin/perl    perl commands text
  735. 0    string        eval\ "exec\ /usr/local/bin/perl    perl commands text
  736.  
  737. # AT&T Bell Labs' Plan 9 shell
  738. 0    string        #!/bin/rc    Plan 9 rc shell script text
  739. 0    string        #!\ /bin/rc    Plan 9 rc shell script text
  740. 0    string        #!\    /bin/rc    Plan 9 rc shell script text
  741.  
  742. # bash shell magic, from Peter Tobias (tobias@server.et-inf.fho-emden.de)
  743. 0    string        #!/bin/bash    Bourne-Again shell script text
  744. 0    string        #!\ /bin/bash    Bourne-Again shell script text
  745. 0    string        #!\    /bin/bash    Bourne-Again shell script text
  746. 0    string        #!/usr/local/bin/bash    Bourne-Again shell script text
  747. 0    string        #!\ /usr/local/bin/bash    Bourne-Again shell script text
  748. 0    string        #!\    /usr/local/bin/bash    Bourne-Again shell script text
  749.  
  750. # generic shell magic
  751. 0    string        #!\ /            a
  752. >3    string        >\0            %s script text
  753. 0    string        #!\    /        a
  754. >3    string        >\0            %s script text
  755. 0    string        #!/            a
  756. >2    string        >\0            %s script text
  757. 0    string        #!\             commands text
  758. >3    string        >\0            for %s
  759.  
  760. #------------------------------------------------------------------------------
  761. # compress:  file(1) magic for pure-compression formats (no archives)
  762. #
  763. # compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc.
  764. #
  765. # Formats for various forms of compressed data
  766. # Formats for "compress" proper have been moved into "compress.c",
  767. # because it tries to uncompress it to figure out what's inside.
  768.  
  769. # standard unix compress
  770. 0    string        \037\235    compress'd data
  771. >2    byte&0x80    >0        block compressed
  772. >2    byte&0x1f    x        %d bits
  773.  
  774. # gzip (GNU zip, not to be confused with Info-ZIP or PKWARE zip archiver)
  775. 0       string          \037\213        gzip compressed data
  776. >2      byte            <8              \b, reserved method,
  777. >2      byte            8               \b, deflated,
  778. >3    byte        &0x01        ASCII,
  779. >3    byte        &0x02        continuation,
  780. >3    byte        &0x04        extra field,
  781. >3    byte        &0x08        original filename,
  782. >3    byte        &0x10        comment,
  783. >3    byte        &0x20        encrypted,
  784. >4    ledate        x        last modified: %s,
  785. >8    byte        2        max compression,
  786. >8    byte        4        max speed,
  787. >9    byte        =0x00        os: MS-DOS
  788. >9    byte        =0x01        os: Amiga
  789. >9    byte        =0x02        os: VMS
  790. >9    byte        =0x03        os: Unix
  791. >9    byte        =0x05        os: Atari
  792. >9    byte        =0x06        os: OS/2
  793. >9    byte        =0x07        os: MacOS
  794. >9    byte        =0x0A        os: Tops/20
  795. >9    byte        =0x0B        os: Win/32
  796.  
  797. # packed data, Huffman (minimum redundancy) codes on a byte-by-byte basis
  798. 0    string        \037\036    packed data
  799. >2    belong        >1        \b, %d characters originally
  800. >2    belong        =1        \b, %d character originally
  801. #
  802. # This magic number is byte-order-independent.  XXX - Does that mean this
  803. # is big-endian, little-endian, either, or that you can't tell?
  804. # this short is valid for SunOS
  805. 0    short        017437        old packed data
  806.  
  807. # XXX - why *two* entries for "compacted data", one of which is
  808. # byte-order independent, and one of which is byte-order dependent?
  809. #
  810. 0    short        0x1fff        compacted data
  811. # This string is valid for SunOS (BE) and a matching "short" is listed
  812. # in the Ultrix (LE) magic file.
  813. 0    string        \377\037    compacted data
  814. 0    short        0145405        huf output
  815.  
  816. # bzip2
  817. 0    string        BZh        bzip2 compressed data
  818. >3    byte        >47        \b, block size = %c00k
  819.  
  820. # squeeze and crunch
  821. # Michael Haardt <michael@cantor.informatik.rwth-aachen.de>
  822. 0    leshort        0xFF76        squeezed data,
  823. >4    string        x        original name %s
  824. 0    leshort        0xFE76        crunched data,
  825. >2    string        x        original name %s
  826. 0    leshort        0xFD76        LZH compressed data,
  827. >2    string        x        original name %s
  828.  
  829. # Freeze
  830. 0    string        \037\237    frozen file 2.1
  831. 0    string        \037\236    frozen file 1.0 (or gzip 0.5)
  832.  
  833. # SCO compress -H (LZH)
  834. 0    string        \037\240    SCO compress -H (LZH) data
  835.  
  836. # European GSM 06.10 is a provisional standard for full-rate speech
  837. # transcoding, prI-ETS 300 036, which uses RPE/LTP (residual pulse
  838. # excitation/long term prediction) coding at 13 kbit/s.
  839. #
  840. # There's only a magic nibble (4 bits); that nibble repeats every 33
  841. # bytes.  This isn't suited for use, but maybe we can use it someday.
  842. #
  843. # This will cause very short GSM files to be declared as data and
  844. # mismatches to be declared as data too!
  845. #0    byte&0xF0    0xd0        data
  846. #>33    byte&0xF0    0xd0
  847. #>66    byte&0xF0    0xd0
  848. #>99    byte&0xF0    0xd0
  849. #>132    byte&0xF0    0xd0        GSM 06.10 compressed audio
  850.  
  851. # bzip    a block-sorting file compressor
  852. #    by Julian Seward <sewardj@cs.man.ac.uk> and others
  853. #
  854. 0    string        BZ        bzip compressed    data
  855. >2    byte        x        \b, version: %c
  856. >3    string        =1        \b, compression block size 100k
  857. >3    string        =2        \b, compression block size 200k
  858. >3    string        =3        \b, compression block size 300k
  859. >3    string        =4        \b, compression block size 400k
  860. >3    string        =5        \b, compression block size 500k
  861. >3    string        =6        \b, compression block size 600k
  862. >3    string        =7        \b, compression block size 700k
  863. >3    string        =8        \b, compression block size 800k
  864. >3    string        =9        \b, compression block size 900k
  865. #------------------------------------------------------------------------------
  866. # convex:  file(1) magic for Convex boxes
  867. #
  868. # Convexes are big-endian.
  869. #
  870. # /*\
  871. #  * Below are the magic numbers and tests added for Convex.
  872. #  * Added at beginning, because they are expected to be used most.
  873. # \*/
  874. 0    belong    0507    Convex old-style object
  875. >16    belong    >0    not stripped
  876. 0    belong    0513    Convex old-style demand paged executable
  877. >16    belong    >0    not stripped
  878. 0    belong    0515    Convex old-style pre-paged executable
  879. >16    belong    >0    not stripped
  880. 0    belong    0517    Convex old-style pre-paged, non-swapped executable
  881. >16    belong    >0    not stripped
  882. 0    belong    0x011257    Core file
  883. #
  884. # The following are a series of dump format magic numbers.  Each one
  885. # corresponds to a drastically different dump format.  The first on is
  886. # the original dump format on a 4.1 BSD or earlier file system.  The
  887. # second marks the change between the 4.1 file system and the 4.2 file
  888. # system.  The Third marks the changing of the block size from 1K
  889. # to 2K to be compatible with an IDC file system.  The fourth indicates
  890. # a dump that is dependent on Convex Storage Manager, because data in
  891. # secondary storage is not physically contained within the dump.
  892. # The restore program uses these number to determine how the data is
  893. # to be extracted.
  894. #
  895. 24    belong    =60011    dump format, 4.1 BSD or earlier
  896. 24    belong    =60012    dump format, 4.2 or 4.3 BSD without IDC
  897. 24    belong    =60013    dump format, 4.2 or 4.3 BSD (IDC compatible)
  898. 24    belong    =60014    dump format, Convex Storage Manager by-reference dump
  899. #
  900. # what follows is a bunch of bit-mask checks on the flags field of the opthdr.
  901. # If there is no `=' sign, assume just checking for whether the bit is set?
  902. #
  903. 0    belong    0601        Convex SOFF
  904. >88    belong&0x000f0000    =0x00000000    c1
  905. >88    belong            &0x00010000    c2
  906. >88    belong            &0x00020000    c2mp
  907. >88    belong            &0x00040000    parallel
  908. >88    belong            &0x00080000    intrinsic
  909. >88    belong            &0x00000001    demand paged
  910. >88    belong            &0x00000002    pre-paged
  911. >88    belong            &0x00000004    non-swapped
  912. >88    belong            &0x00000008    POSIX
  913. #
  914. >84    belong            &0x80000000    executable
  915. >84    belong            &0x40000000    object
  916. >84    belong&0x20000000    =0        not stripped
  917. >84    belong&0x18000000    =0x00000000    native fpmode
  918. >84    belong&0x18000000    =0x10000000    ieee fpmode
  919. >84    belong&0x18000000    =0x18000000    undefined fpmode
  920. #
  921. 0    belong            0605        Convex SOFF core
  922. #
  923. 0    belong            0607        Convex SOFF checkpoint
  924. >88    belong&0x000f0000    =0x00000000    c1
  925. >88    belong            &0x00010000    c2
  926. >88    belong            &0x00020000    c2mp
  927. >88    belong            &0x00040000    parallel
  928. >88    belong            &0x00080000    intrinsic
  929. >88    belong            &0x00000008    POSIX
  930. #
  931. >84    belong&0x18000000    =0x00000000    native fpmode
  932. >84    belong&0x18000000    =0x10000000    ieee fpmode
  933. >84    belong&0x18000000    =0x18000000    undefined fpmode
  934.  
  935. #------------------------------------------------------------------------------
  936. # database:  file(1) magic for various databases
  937. #
  938. # extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk)
  939. #
  940. #
  941. # GDBM magic numbers
  942. #  Will be maintained as part of the GDBM distribution in the future.
  943. #  <downsj@teeny.org>
  944. 0    belong    0x13579ace    GNU dbm 1.x or ndbm database, big endian
  945. 0    lelong    0x13579ace    GNU dbm 1.x or ndbm database, little endian
  946. 0    string    GDBM        GNU dbm 2.x database
  947. #
  948. 0    belong    0x061561    Berkeley DB Hash file
  949. >4    belong    >0        (Version %d,
  950. >8    belong    1234        Little Endian,
  951. >8    belong    4321        Big Endian,
  952. >12    belong    x        Bucket Size %d,
  953. >16    belong    x        Bucket Shift %d,
  954. >20    belong    x        Directory Size %d,
  955. >24    belong    x        Segment Size %d,
  956. >28    belong    x        Segment Shift %d,
  957. >32    belong    x        Overflow Point %d,
  958. >36    belong    x        Last Freed %d,
  959. >40    belong    x        Max Bucket %d,
  960. >44    belong    x        High Mask 0x%x,
  961. >48    belong    x        Low Mask 0x%x,
  962. >52    belong    x        Fill Factor %d,
  963. >56    belong    x        Number of Keys %d)
  964. #
  965. #
  966. 0    belong    0x053162    Berkeley DB Btree file
  967. >4    belong    >0        (Version %d,
  968. >8    belong    x        Page Size %d,
  969. >12    belong    x        Free Page %d,
  970. >16    belong    x        Number of Records %d,
  971. >20    belong    x        Flags 0x%x)
  972.  
  973. #------------------------------------------------------------------------------
  974. # diamond:  file(1) magic for Diamond system
  975. #
  976. # ... diamond is a multi-media mail and electronic conferencing system....
  977. #
  978. # XXX - I think it was either renamed Slate, or replaced by Slate....
  979. #
  980. #    The full deal is too long...
  981. #0    string    <list>\n<protocol\ bbn-multimedia-format>    Diamond Multimedia Document
  982. 0    string    =<list>\n<protocol\ bbn-m    Diamond Multimedia Document
  983.  
  984. #------------------------------------------------------------------------------
  985. # diff:  file(1) magic for diff(1) output
  986. #
  987. 0    string        diff\     'diff' output text
  988. 0    string        ***\         'diff' output text
  989. 0    string        Only\ in\     'diff' output text
  990. 0    string        Common\ subdirectories:\     'diff' output text
  991. #  Digital UNIX - Info
  992. #
  993. 0    string    !<arch>\n________64E    Alpha archive
  994. >22    string    X            -- out of date
  995. #
  996. # Alpha COFF Based Executables
  997. # The stripped stuff really needs to be an 8 byte (64 bit) compare,
  998. # but this works
  999. 0    leshort        0x183        COFF format alpha
  1000. >22    leshort&020000    &010000        sharable library,
  1001. >22    leshort&020000    ^010000        dynamically linked,
  1002. >24    leshort        0410        pure
  1003. >24    leshort        0413        demand paged
  1004. >8    lelong        >0        executable or object module, not stripped
  1005. >8    lelong        0
  1006. >>12    lelong        0        executable or object module, stripped
  1007. >>12    lelong        >0        executable or object module, not stripped
  1008. >27     byte            >0              - version %d.
  1009. >26     byte            >0              %d-
  1010. >28     leshort         >0              %d
  1011. #
  1012. # The next is incomplete, we could tell more about this format,
  1013. # but its not worth it.
  1014. 0    leshort        0x188    Alpha compressed COFF
  1015. 0    leshort        0x18f    Alpha u-code object
  1016. #
  1017. #
  1018. # Some other interesting Digital formats,
  1019. 0    string    \377\377\177        ddis/ddif
  1020. 0    string    \377\377\174        ddis/dots archive
  1021. 0    string    \377\377\176        ddis/dtif table data
  1022. 0    string    \033c\033        LN03 output
  1023. 0    long    04553207        X image
  1024. #
  1025. 0    string    !<PDF>!\n        profiling data file
  1026. #
  1027. # Locale data tables (MIPS and Alpha).
  1028. #
  1029. 0    short        0x0501        locale data table
  1030. >6    short        0x24        for MIPS
  1031. >6    short        0x40        for Alpha
  1032.  
  1033. #------------------------------------------------------------------------------
  1034. # dump:  file(1) magic for dump file format--for new and old dump filesystems
  1035. #
  1036. # We specify both byte orders in order to recognize byte-swapped dumps.
  1037. #
  1038. 24    belong    60012        new-fs dump file (big endian),
  1039. >4    bedate    x        Previous dump %s,
  1040. >8    bedate    x        This dump %s,
  1041. >12    belong    >0        Volume %ld,
  1042. >692    belong    0        Level zero, type:
  1043. >692    belong    >0        Level %d, type:
  1044. >0    belong    1        tape header,
  1045. >0    belong    2        beginning of file record,
  1046. >0    belong    3        map of inodes on tape,
  1047. >0    belong    4        continuation of file record,
  1048. >0    belong    5        end of volume,
  1049. >0    belong    6        map of inodes deleted,
  1050. >0    belong    7        end of medium (for floppy),
  1051. >676    string    >\0        Label %s,
  1052. >696    string    >\0        Filesystem %s,
  1053. >760    string    >\0        Device %s,
  1054. >824    string    >\0        Host %s,
  1055. >888    belong    >0        Flags %x
  1056.  
  1057. 24    belong    60011        old-fs dump file (big endian),
  1058. #>4    bedate    x        Previous dump %s,
  1059. #>8    bedate    x        This dump %s,
  1060. >12    belong    >0        Volume %ld,
  1061. >692    belong    0        Level zero, type:
  1062. >692    belong    >0        Level %d, type:
  1063. >0    belong    1        tape header,
  1064. >0    belong    2        beginning of file record,
  1065. >0    belong    3        map of inodes on tape,
  1066. >0    belong    4        continuation of file record,
  1067. >0    belong    5        end of volume,
  1068. >0    belong    6        map of inodes deleted,
  1069. >0    belong    7        end of medium (for floppy),
  1070. >676    string    >\0        Label %s,
  1071. >696    string    >\0        Filesystem %s,
  1072. >760    string    >\0        Device %s,
  1073. >824    string    >\0        Host %s,
  1074. >888    belong    >0        Flags %x
  1075.  
  1076. 24    lelong    60012        new-fs dump file (little endian),
  1077. >4    ledate    x        This dump %s,
  1078. >8    ledate    x        Previous dump %s,
  1079. >12    lelong    >0        Volume %ld,
  1080. >692    lelong    0        Level zero, type:
  1081. >692    lelong    >0        Level %d, type:
  1082. >0    lelong    1        tape header,
  1083. >0    lelong    2        beginning of file record,
  1084. >0    lelong    3        map of inodes on tape,
  1085. >0    lelong    4        continuation of file record,
  1086. >0    lelong    5        end of volume,
  1087. >0    lelong    6        map of inodes deleted,
  1088. >0    lelong    7        end of medium (for floppy),
  1089. >676    string    >\0        Label %s,
  1090. >696    string    >\0        Filesystem %s,
  1091. >760    string    >\0        Device %s,
  1092. >824    string    >\0        Host %s,
  1093. >888    lelong    >0        Flags %x
  1094.  
  1095. 24    lelong    60011        old-fs dump file (little endian),
  1096. #>4    ledate    x        Previous dump %s,
  1097. #>8    ledate    x        This dump %s,
  1098. >12    lelong    >0        Volume %ld,
  1099. >692    lelong    0        Level zero, type:
  1100. >692    lelong    >0        Level %d, type:
  1101. >0    lelong    1        tape header,
  1102. >0    lelong    2        beginning of file record,
  1103. >0    lelong    3        map of inodes on tape,
  1104. >0    lelong    4        continuation of file record,
  1105. >0    lelong    5        end of volume,
  1106. >0    lelong    6        map of inodes deleted,
  1107. >0    lelong    7        end of medium (for floppy),
  1108. >676    string    >\0        Label %s,
  1109. >696    string    >\0        Filesystem %s,
  1110. >760    string    >\0        Device %s,
  1111. >824    string    >\0        Host %s,
  1112. >888    lelong    >0        Flags %x
  1113.  
  1114. #------------------------------------------------------------------------------
  1115. # elf:  file(1) magic for ELF executables
  1116. #
  1117. # We have to check the byte order flag to see what byte order all the
  1118. # other stuff in the header is in.
  1119. #
  1120. # MIPS R3000 may also be for MIPS R2000.
  1121. # What're the correct byte orders for the nCUBE and the Fujitsu VPP500?
  1122. #
  1123. # updated by Daniel Quinlan (quinlan@yggdrasil.com)
  1124. 0    string        \177ELF        ELF
  1125. >4    byte        0        invalid class
  1126. >4    byte        1        32-bit
  1127. >4    byte        2        64-bit
  1128. >5    byte        0        invalid byte order
  1129. >5    byte        1        LSB
  1130. >>16    leshort        0        no file type,
  1131. >>16    leshort        1        relocatable,
  1132. >>16    leshort        2        executable,
  1133. >>16    leshort        3        shared object,
  1134. # Core handling from Peter Tobias <tobias@server.et-inf.fho-emden.de>
  1135. # corrections by Christian 'Dr. Disk' Hechelmann <drdisk@ds9.au.s.shuttle.de>
  1136. >>16    leshort        4        core file
  1137. >>>(0x38+0xcc) string    >\0        of '%s'
  1138. >>>(0x38+0x10) lelong    >0        (signal %d),
  1139. >>16    leshort        &0xff00        processor-specific,
  1140. >>18    leshort        0        no machine,
  1141. >>18    leshort        1        AT&T WE32100 - invalid byte order,
  1142. >>18    leshort        2        SPARC - invalid byte order,
  1143. >>18    leshort        3        Intel 80386,
  1144. >>18    leshort        4        Motorola 68000 - invalid byte order,
  1145. >>18    leshort        5        Motorola 88000 - invalid byte order,
  1146. >>18    leshort        6        Intel 80486,
  1147. >>18    leshort        7        Intel 80860,
  1148. >>18    leshort        8        MIPS R3000_BE - invalid byte order,
  1149. >>18    leshort        9        Amdahl - invalid byte order,
  1150. >>18    leshort        10        MIPS R3000_LE,
  1151. >>18    leshort        11        RS6000 - invalid byte order,
  1152. >>18    leshort        15        PA-RISC - invalid byte order,
  1153. >>18    leshort        16        nCUBE,
  1154. >>18    leshort        17        VPP500,
  1155. >>18    leshort        18        SPARC32PLUS,
  1156. >>18    leshort        20        PowerPC,
  1157. >>18    leshort        0x9026        Alpha,
  1158. >>20    lelong        0        invalid version
  1159. >>20    lelong        1        version 1
  1160. >>36    lelong        1        MathCoPro/FPU/MAU Required
  1161. >8    string        >\0        (%s)
  1162. >5    byte        2        MSB
  1163. >>16    beshort        0        no file type,
  1164. >>16    beshort        1        relocatable,
  1165. >>16    beshort        2        executable,
  1166. >>16    beshort        3        shared object,
  1167. >>16    beshort        4        core file,
  1168. >>>(0x38+0xcc) string    >\0        of '%s'
  1169. >>>(0x38+0x10) belong    >0        (signal %d),
  1170. >>16    beshort        &0xff00        processor-specific,
  1171. >>18    beshort        0        no machine,
  1172. >>18    beshort        1        AT&T WE32100,
  1173. >>18    beshort        2        SPARC,
  1174. >>18    beshort        3        Intel 80386 - invalid byte order,
  1175. >>18    beshort        4        Motorola 68000,
  1176. >>18    beshort        5        Motorola 88000,
  1177. >>18    beshort        6        Intel 80486 - invalid byte order,
  1178. >>18    beshort        7        Intel 80860,
  1179. >>18    beshort        8        MIPS R3000_BE,
  1180. >>18    beshort        9        Amdahl,
  1181. >>18    beshort        10        MIPS R3000_LE - invalid byte order,
  1182. >>18    beshort        11        RS6000,
  1183. >>18    beshort        15        PA-RISC,
  1184. >>18    beshort        16        nCUBE,
  1185. >>18    beshort        17        VPP500,
  1186. >>18    beshort        18        SPARC32PLUS,
  1187. >>18    beshort        20        PowerPC or cisco 4500,
  1188. >>18    beshort        21        cisco 7500,
  1189. >>18    beshort        24        cisco SVIP,
  1190. >>18    beshort        25        cisco 7200,
  1191. >>18    beshort        36        cisco 12000,
  1192. >>18    beshort        0x9026        Alpha,
  1193. >>20    belong        0        invalid version
  1194. >>20    belong        1        version 1
  1195. >>36    belong        1        MathCoPro/FPU/MAU Required
  1196.  
  1197. #------------------------------------------------------------------------------
  1198. # encore:  file(1) magic for Encore machines
  1199. #
  1200. # XXX - needs to have the byte order specified (NS32K was little-endian,
  1201. # dunno whether they run the 88K in little-endian mode or not).
  1202. #
  1203. 0    short        0x154        Encore
  1204. >20    short        0x107        executable
  1205. >20    short        0x108        pure executable
  1206. >20    short        0x10b        demand-paged executable
  1207. >20    short        0x10f        unsupported executable
  1208. >12    long        >0        not stripped
  1209. >22    short        >0        - version %ld
  1210. >22    short        0        -
  1211. #>4    date        x        stamp %s
  1212. 0    short        0x155        Encore unsupported executable
  1213. >12    long        >0        not stripped
  1214. >22    short        >0        - version %ld
  1215. >22    short        0        -
  1216. #>4    date        x        stamp %s
  1217.  
  1218. #------------------------------------------------------------------------------
  1219. # filesystems:  file(1) magic for different filesystems
  1220. #
  1221. 0x438    leshort    0xEF53            Linux/i386 ext2 filesystem
  1222. 0    string    \366\366\366\366    PC formatted floppy with no filesystem
  1223. # Sun disk labels
  1224. # From /usr/include/sun/dklabel.h:
  1225. 0774    beshort        0xdabe        Sun disk label
  1226. >0    string        x        '%s
  1227. >>31      string        >\0        \b%s
  1228. >>>63      string        >\0        \b%s
  1229. >>>>95     string        >\0        \b%s
  1230. >0    string        x        \b'
  1231. >0734    short        >0        %d rpm,
  1232. >0736    short        >0        %d phys cys,
  1233. >0740    short        >0        %d alts/cyl,
  1234. >0746    short        >0        %d interleave,
  1235. >0750    short        >0        %d data cyls,
  1236. >0752    short        >0        %d alt cyls,
  1237. >0754    short        >0        %d heads/partition,
  1238. >0756    short        >0        %d sectors/track,
  1239. >0764    long        >0        start cyl %ld,
  1240. >0770    long        x        %ld blocks
  1241. # Is there a boot block written 1 sector in?
  1242. >512    belong&077777777    0600407    \b, boot block present
  1243. 0x1FE    leshort    0xAA55            x86 boot sector
  1244. >2    string    OSBS            \b, OS/BS MBR
  1245. >0x8C    string    Invalid\ partition\ table    \b, MS-DOS MBR
  1246. >0    string    \0\0\0\0        \b, extended partition table
  1247. >0    leshort 0x3CEB            \b, system
  1248. >>3    string    >\0            %s
  1249. >>0x36    string    FAT            \b, %s
  1250. >>>0x39    string    12            (%s bit)
  1251. >>>0x39    string    16            (%s bit)
  1252. >0x200    lelong    0x82564557        \b, BSD disklabel
  1253.  
  1254. #------------------------------------------------------------------------------
  1255. # fonts:  file(1) magic for font data
  1256. #
  1257. 0    string        FONT        ASCII vfont text
  1258. 0    short        0436        Berkeley vfont data
  1259. 0    short        017001        byte-swapped Berkeley vfont data
  1260.  
  1261. # PostScript fonts (must precede "printer" entries), quinlan@yggdrasil.com
  1262. 0    string        %!PS-AdobeFont-1.0    PostScript Type 1 font text
  1263. >20    string        >\0            (%s)
  1264. 6    string        %!PS-AdobeFont-1.0    PostScript Type 1 font program data
  1265.  
  1266. # X11 font files in SNF (Server Natural Format) format
  1267. 0    belong        00000004        X11 SNF font data, MSB first
  1268. 0    lelong        00000004        X11 SNF font data, LSB first
  1269.  
  1270. # X11 Bitmap Distribution Format, from Daniel Quinlan (quinlan@yggdrasil.com)
  1271. 0    string        STARTFONT\040        X11 BDF font text
  1272.  
  1273. # X11 fonts, from Daniel Quinlan (quinlan@yggdrasil.com)
  1274. # PCF must come before SGI additions ("MIPSEL MIPS-II COFF" collides)
  1275. 0    string        \001fcp            X11 Portable Compiled Font data
  1276. >12    byte        0x02            \b, LSB first
  1277. >12    byte        0x0a            \b, MSB first
  1278. 0    string        D1.0\015        X11 Speedo font data
  1279.  
  1280. #------------------------------------------------------------------------------
  1281. # FIGlet fonts and controlfiles
  1282. # From figmagic supplied with Figlet version 2.2
  1283. # "David E. O'Brien" <obrien@FreeBSD.ORG>
  1284. 0    string        flf        FIGlet font
  1285. >3    string        >2a        version %-2.2s
  1286. 0    string        flc        FIGlet controlfile
  1287. >3    string        >2a        version %-2.2s
  1288.  
  1289. # libGrx graphics lib fonts, from Albert Cahalan (acahalan@cs.uml.edu)
  1290. # Used with djgpp (DOS Gnu C++), sometimes Linux or Turbo C++
  1291. 0    belong        0x14025919    libGrx font data,
  1292. >8    leshort        x        %dx
  1293. >10    leshort        x        \b%d
  1294. >40    string        x        %s
  1295. # Misc. DOS VGA fonts, from Albert Cahalan (acahalan@cs.uml.edu)
  1296. 0    belong        0xff464f4e    DOS code page font data collection
  1297. 7    belong        0x00454741    DOS code page font data
  1298. 7    belong        0x00564944    DOS code page font data (from Linux?)
  1299. 4098    string        DOSFONT        DOSFONT2 encrypted font data
  1300.  
  1301.  
  1302. #------------------------------------------------------------------------------
  1303. # frame:  file(1) magic for FrameMaker files
  1304. #
  1305. # This stuff came on a FrameMaker demo tape, most of which is
  1306. # copyright, but this file is "published" as witness the following:
  1307. #
  1308. 0    string        \<MakerFile    FrameMaker document
  1309. >11    string        5.0         (5.0
  1310. >11    string        4.0         (4.0
  1311. >11    string        3.0         (3.0
  1312. >11    string        2.0         (2.0
  1313. >11    string        1.0         (1.0
  1314. >14    byte        x          %c)
  1315. 0    string        \<MIFFile    FrameMaker MIF (ASCII) file
  1316. >9    string        4.0         (4.0)
  1317. >9    string        3.0         (3.0)
  1318. >9    string        2.0         (2.0)
  1319. >9    string        1.0         (1.x)
  1320. 0    string        \<MakerDictionary    FrameMaker Dictionary text
  1321. >17    string        3.0         (3.0)
  1322. >17    string        2.0         (2.0)
  1323. >17    string        1.0         (1.x)
  1324. 0    string        \<MakerScreenFont    FrameMaker Font file
  1325. >17    string        1.01         (%s)
  1326. 0    string        \<MML        FrameMaker MML file
  1327. 0    string        \<BookFile    FrameMaker Book file
  1328. >10    string        3.0         (3.0
  1329. >10    string        2.0         (2.0
  1330. >10    string        1.0         (1.0
  1331. >13    byte        x          %c)
  1332. # XXX - this book entry should be verified, if you find one, uncomment this
  1333. #0    string        \<Book\     FrameMaker Book (ASCII) file
  1334. #>6    string        3.0         (3.0)
  1335. #>6    string        2.0         (2.0)
  1336. #>6    string        1.0         (1.0)
  1337. 0    string        \<Maker    Intermediate Print File    FrameMaker IPL file
  1338.  
  1339. #------------------------------------------------------------------------------
  1340. # freebsd:  file(1) magic for FreeBSD objects
  1341. #
  1342. # All new-style FreeBSD magic numbers are in host byte order (i.e.,
  1343. # little-endian on x86).
  1344. #
  1345. # XXX - this comes from the file "freebsd" in a recent FreeBSD version of
  1346. # "file"; it, and the NetBSD stuff in "netbsd", appear to use different
  1347. # schemes for distinguishing between executable images, shared libraries,
  1348. # and object files.
  1349. #
  1350. # FreeBSD says:
  1351. #
  1352. #    Regardless of whether it's pure, demand-paged, or none of the
  1353. #    above:
  1354. #
  1355. #    if the entry point is < 4096, then it's a shared library if
  1356. #    the "has run-time loader information" bit is set, and is
  1357. #    position-independent if the "is position-independent" bit
  1358. #    is set;
  1359. #
  1360. #    if the entry point is >= 4096 (or >4095, same thing), then it's
  1361. #    an executable, and is dynamically-linked if the "has run-time
  1362. #    loader information" bit is set.
  1363. #
  1364. # On x86, NetBSD says:
  1365. #
  1366. #    If it's neither pure nor demand-paged:
  1367. #
  1368. #    if it has the "has run-time loader information" bit set, it's
  1369. #    a dynamically-linked executable;
  1370. #
  1371. #    if it doesn't have that bit set, then:
  1372. #
  1373. #        if it has the "is position-independent" bit set, it's
  1374. #        position-independent;
  1375. #
  1376. #        if the entry point is non-zero, it's an executable, otherwise
  1377. #        it's an object file.
  1378. #
  1379. #    If it's pure:
  1380. #
  1381. #    if it has the "has run-time loader information" bit set, it's
  1382. #    a dynamically-linked executable, otherwise it's just an
  1383. #    executable.
  1384. #
  1385. #    If it's demand-paged:
  1386. #
  1387. #    if it has the "has run-time loader information" bit set,
  1388. #    then:
  1389. #
  1390. #        if the entry point is < 4096, it's a shared library;
  1391. #
  1392. #        if the entry point is = 4096 or > 4096 (i.e., >= 4096),
  1393. #        it's a dynamically-linked executable);
  1394. #
  1395. #    if it doesn't have the "has run-time loader information" bit
  1396. #    set, then it's just an executable.
  1397. #
  1398. # (On non-x86, NetBSD does much the same thing, except that it uses
  1399. # 8192 on 68K - except for "68k4k", which is presumably "68K with 4K
  1400. # pages - SPARC, and MIPS, presumably because Sun-3's and Sun-4's
  1401. # had 8K pages; dunno about MIPS.)
  1402. #
  1403. # I suspect the two will differ only in perverse and uninteresting cases
  1404. # ("shared" libraries that aren't demand-paged and whose pages probably
  1405. # won't actually be shared, executables with entry points <4096).
  1406. #
  1407. # I leave it to those more familiar with FreeBSD and NetBSD to figure out
  1408. # what the right answer is (although using ">4095", FreeBSD-style, is
  1409. # probably better than separately checking for "=4096" and ">4096",
  1410. # NetBSD-style).  (The old "netbsd" file analyzed FreeBSD demand paged
  1411. # executables using the NetBSD technique.)
  1412. #
  1413. 0    lelong&0377777777    041400407    FreeBSD/i386
  1414. >20    lelong            <4096
  1415. >>3    byte&0xC0        &0x80        shared library
  1416. >>3    byte&0xC0        0x40        PIC object
  1417. >>3    byte&0xC0        0x00        object
  1418. >20    lelong            >4095
  1419. >>3    byte&0x80        0x80        dynamically linked executable
  1420. >>3    byte&0x80        0x00        executable
  1421. >16    lelong            >0        not stripped
  1422.  
  1423. 0    lelong&0377777777    041400410    FreeBSD/i386 pure
  1424. >20    lelong            <4096
  1425. >>3    byte&0xC0        &0x80        shared library
  1426. >>3    byte&0xC0        0x40        PIC object
  1427. >>3    byte&0xC0        0x00        object
  1428. >20    lelong            >4095
  1429. >>3    byte&0x80        0x80        dynamically linked executable
  1430. >>3    byte&0x80        0x00        executable
  1431. >16    lelong            >0        not stripped
  1432.  
  1433. 0    lelong&0377777777    041400413    FreeBSD/i386 demand paged
  1434. >20    lelong            <4096
  1435. >>3    byte&0xC0        &0x80        shared library
  1436. >>3    byte&0xC0        0x40        PIC object
  1437. >>3    byte&0xC0        0x00        object
  1438. >20    lelong            >4095
  1439. >>3    byte&0x80        0x80        dynamically linked executable
  1440. >>3    byte&0x80        0x00        executable
  1441. >16    lelong            >0        not stripped
  1442.  
  1443. 0    lelong&0377777777    041400314    FreeBSD/i386 compact demand paged
  1444. >20    lelong            <4096
  1445. >>3    byte&0xC0        &0x80        shared library
  1446. >>3    byte&0xC0        0x40        PIC object
  1447. >>3    byte&0xC0        0x00        object
  1448. >20    lelong            >4095
  1449. >>3    byte&0x80        0x80        dynamically linked executable
  1450. >>3    byte&0x80        0x00        executable
  1451. >16    lelong            >0        not stripped
  1452.  
  1453. # XXX gross hack to identify core files
  1454. # cores start with a struct tss; we take advantage of the following:
  1455. # byte 7:     highest byte of the kernel stack pointer, always 0xfe
  1456. #      8/9:   kernel (ring 0) ss value, always 0x0010
  1457. #      10 - 27: ring 1 and 2 ss/esp, unused, thus always 0
  1458. #      28:    low order byte of the current PTD entry, always 0 since the
  1459. #             PTD is page-aligned
  1460. #
  1461. 7    string    \357\020\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0    FreeBSD/i386 a.out core file
  1462. >1039    string    >\0    from '%s'
  1463.  
  1464. # /var/run/ld.so.hints
  1465. # What are you laughing about?
  1466. 0    lelong            011421044151    ld.so hints file
  1467. >4    lelong            >0        (version %d)
  1468.  
  1469. #------------------------------------------------------------------------------
  1470. # hp:  file(1) magic for Hewlett Packard machines (see also "printer")
  1471. #
  1472. # XXX - somebody should figure out whether any byte order needs to be
  1473. # applied to the "TML" stuff; I'm assuming the Apollo stuff is
  1474. # big-endian as it was mostly 68K-based.
  1475. #
  1476. # I think the 500 series was the old stack-based machines, running a
  1477. # UNIX environment atop the "SUN kernel"; dunno whether it was
  1478. # big-endian or little-endian.
  1479. #
  1480. # Daniel Quinlan (quinlan@yggdrasil.com): hp200 machines are 68010 based;
  1481. # hp300 are 68020+68881 based; hp400 are also 68k.  The following basic
  1482. # HP magic is useful for reference, but using "long" magic is a better
  1483. # practice in order to avoid collisions.
  1484. #
  1485. # Guy Harris (guy@netapp.com): some additions to this list came from
  1486. # HP-UX 10.0's "/usr/include/sys/unistd.h" (68030, 68040, PA-RISC 1.1,
  1487. # 1.2, and 2.0).  The 1.2 and 2.0 stuff isn't in the HP-UX 10.0
  1488. # "/etc/magic", though, except for the "archive file relocatable library"
  1489. # stuff, and the 68030 and 68040 stuff isn't there at all - are they not
  1490. # used in executables, or have they just not yet updated "/etc/magic"
  1491. # completely?
  1492. #
  1493. # 0    beshort        200        hp200 (68010) BSD binary
  1494. # 0    beshort        300        hp300 (68020+68881) BSD binary
  1495. # 0    beshort        0x20c        hp200/300 HP-UX binary
  1496. # 0    beshort        0x20d        hp400 (68030) HP-UX binary
  1497. # 0    beshort        0x20e        hp400 (68040?) HP-UX binary
  1498. # 0    beshort        0x20b        PA-RISC1.0 HP-UX binary
  1499. # 0    beshort        0x210        PA-RISC1.1 HP-UX binary
  1500. # 0    beshort        0x211        PA-RISC1.2 HP-UX binary
  1501. # 0    beshort        0x214        PA-RISC2.0 HP-UX binary
  1502.  
  1503. #
  1504. # The "misc" stuff needs a byte order; the archives look suspiciously
  1505. # like the old 177545 archives (0xff65 = 0177545).
  1506. #
  1507. #### Old Apollo stuff
  1508. 0    beshort        0627        Apollo m68k COFF executable
  1509. >18    beshort        ^040000        not stripped
  1510. >22    beshort        >0        - version %ld
  1511. 0    beshort        0624        apollo a88k COFF executable
  1512. >18    beshort        ^040000        not stripped
  1513. >22    beshort        >0        - version %ld
  1514. 0       long            01203604016     TML 0123 byte-order format
  1515. 0       long            01702407010     TML 1032 byte-order format
  1516. 0       long            01003405017     TML 2301 byte-order format
  1517. 0       long            01602007412     TML 3210 byte-order format
  1518. #### PA-RISC 1.1
  1519. 0    belong         0x02100106    PA-RISC1.1 relocatable object
  1520. 0    belong         0x02100107    PA-RISC1.1 executable
  1521. >168    belong        &=0x00000004    dynamically linked
  1522. >(144)    belong        0x054ef630    dynamically linked
  1523. >96    belong        >0        - not stripped
  1524.  
  1525. 0    belong         0x02100108    PA-RISC1.1 shared executable
  1526. >168    belong&0x4    0x4        dynamically linked
  1527. >(144)    belong        0x054ef630    dynamically linked
  1528. >96    belong        >0        - not stripped
  1529.  
  1530. 0    belong         0x0210010b    PA-RISC1.1 demand-load executable
  1531. >168    belong&0x4    0x4        dynamically linked
  1532. >(144)    belong        0x054ef630    dynamically linked
  1533. >96    belong        >0        - not stripped
  1534.  
  1535. 0    belong         0x0210010e    PA-RISC1.1 shared library
  1536. >96    belong        >0        - not stripped
  1537.  
  1538. 0    belong         0x0210010d    PA-RISC1.1 dynamic load library
  1539. >96    belong        >0        - not stripped
  1540.  
  1541. #### PA-RISC 2.0
  1542. 0    belong        0x02140106    PA-RISC2.0 relocatable object
  1543.  
  1544. 0       belong        0x02140107    PA-RISC2.0 executable
  1545. >168    belong        &=0x00000004    dynamically linked
  1546. >(144)    belong        0x054ef630    dynamically linked
  1547. >96    belong        >0        - not stripped
  1548.  
  1549. 0       belong        0x02140108    PA-RISC2.0 shared executable
  1550. >168    belong        &=0x00000004    dynamically linked
  1551. >(144)    belong        0x054ef630    dynamically linked
  1552. >96    belong        >0        - not stripped
  1553.  
  1554. 0       belong        0x0214010b    PA-RISC2.0 demand-load executable
  1555. >168    belong        &=0x00000004    dynamically linked
  1556. >(144)    belong        0x054ef630    dynamically linked
  1557. >96    belong        >0        - not stripped
  1558.  
  1559. 0       belong        0x0214010e    PA-RISC2.0 shared library
  1560. >96    belong        >0        - not stripped
  1561.  
  1562. 0       belong        0x0214010d    PA-RISC2.0 dynamic load library
  1563. >96    belong        >0        - not stripped
  1564.  
  1565. #### 800
  1566. 0    belong         0x020b0106    PA-RISC1.0 relocatable object
  1567.  
  1568. 0    belong         0x020b0107    PA-RISC1.0 executable
  1569. >168    belong&0x4    0x4        dynamically linked
  1570. >(144)    belong        0x054ef630    dynamically linked
  1571. >96    belong        >0        - not stripped
  1572.  
  1573. 0    belong         0x020b0108    PA-RISC1.0 shared executable
  1574. >168    belong&0x4    0x4        dynamically linked
  1575. >(144)    belong        0x054ef630    dynamically linked
  1576. >96    belong        >0        - not stripped
  1577.  
  1578. 0    belong         0x020b010b    PA-RISC1.0 demand-load executable
  1579. >168    belong&0x4    0x4        dynamically linked
  1580. >(144)    belong        0x054ef630    dynamically linked
  1581. >96    belong        >0        - not stripped
  1582.  
  1583. 0    belong         0x020b010e    PA-RISC1.0 shared library
  1584. >96    belong        >0        - not stripped
  1585.  
  1586. 0    belong         0x020b010d    PA-RISC1.0 dynamic load library
  1587. >96    belong        >0        - not stripped
  1588.  
  1589. 0    belong        0x213c6172    archive file
  1590. >68    belong         0x020b0619    - PA-RISC1.0 relocatable library
  1591. >68    belong         0x02100619    - PA-RISC1.1 relocatable library
  1592. >68    belong         0x02110619    - PA-RISC1.2 relocatable library
  1593. >68    belong         0x02140619    - PA-RISC2.0 relocatable library
  1594.  
  1595. #### 500
  1596. 0    long        0x02080106    HP s500 relocatable executable
  1597. >16    long        >0        - version %ld
  1598.  
  1599. 0    long        0x02080107    HP s500 executable
  1600. >16    long        >0        - version %ld
  1601.  
  1602. 0    long        0x02080108    HP s500 pure executable
  1603. >16    long        >0        - version %ld
  1604.  
  1605. #### 200
  1606. 0    belong         0x020c0108    HP s200 pure executable
  1607. >4    beshort        >0        - version %ld
  1608. >8    belong        &0x80000000    save fp regs
  1609. >8    belong        &0x40000000    dynamically linked
  1610. >8    belong        &0x20000000    debuggable
  1611. >36    belong        >0        not stripped
  1612.  
  1613. 0    belong        0x020c0107    HP s200 executable
  1614. >4    beshort        >0        - version %ld
  1615. >8    belong        &0x80000000    save fp regs
  1616. >8    belong        &0x40000000    dynamically linked
  1617. >8    belong        &0x20000000    debuggable
  1618. >36    belong        >0        not stripped
  1619.  
  1620. 0    belong        0x020c010b    HP s200 demand-load executable
  1621. >4    beshort        >0        - version %ld
  1622. >8    belong        &0x80000000    save fp regs
  1623. >8    belong        &0x40000000    dynamically linked
  1624. >8    belong        &0x20000000    debuggable
  1625. >36    belong        >0        not stripped
  1626.  
  1627. 0    belong        0x020c0106    HP s200 relocatable executable
  1628. >4    beshort        >0        - version %ld
  1629. >6    beshort        >0        - highwater %d
  1630. >8    belong        &0x80000000    save fp regs
  1631. >8    belong        &0x20000000    debuggable
  1632. >8    belong        &0x10000000    PIC
  1633.  
  1634. 0    belong         0x020a0108    HP s200 (2.x release) pure executable
  1635. >4    beshort        >0        - version %ld
  1636. >36    belong        >0        not stripped
  1637.  
  1638. 0    belong        0x020a0107    HP s200 (2.x release) executable
  1639. >4    beshort        >0        - version %ld
  1640. >36    belong        >0        not stripped
  1641.  
  1642. 0    belong        0x020c010e    HP s200 shared library
  1643. >4    beshort        >0        - version %ld
  1644. >6    beshort        >0        - highwater %d
  1645. >36    belong        >0        not stripped
  1646.  
  1647. 0    belong        0x020c010d    HP s200 dynamic load library
  1648. >4    beshort        >0        - version %ld
  1649. >6    beshort        >0        - highwater %d
  1650. >36    belong        >0        not stripped
  1651.  
  1652. #### MISC
  1653. 0    long        0x0000ff65    HP old archive
  1654. 0    long        0x020aff65    HP s200 old archive
  1655. 0    long        0x020cff65    HP s200 old archive
  1656. 0    long        0x0208ff65    HP s500 old archive
  1657.  
  1658. 0    long        0x015821a6    HP core file
  1659.  
  1660. 0    long        0x4da7eee8    HP-WINDOWS font
  1661. >8    byte        >0        - version %ld
  1662. 0    string        Bitmapfile    HP Bitmapfile
  1663.  
  1664. 0    string        IMGfile    CIS     compimg HP Bitmapfile
  1665. # XXX - see "lif"
  1666. #0    short        0x8000        lif file
  1667. 0    long        0x020c010c    compiled Lisp
  1668.  
  1669. 0    string        msgcat01    HP NLS message catalog,
  1670. >8    long        >0        %d messages
  1671.  
  1672. # addendum to /etc/magic with HP-48sx file-types by phk@data.fls.dk 1jan92
  1673. 0    string        HPHP48-        HP48 binary
  1674. >7    byte        >0        - Rev %c
  1675. >8    short        0x1129        (ADR)
  1676. >8    short        0x3329        (REAL)
  1677. >8    short        0x5529        (LREAL)
  1678. >8    short        0x7729        (COMPLX)
  1679. >8    short        0x9d29        (LCOMPLX)
  1680. >8    short        0xbf29        (CHAR)
  1681. >8    short        0xe829        (ARRAY)
  1682. >8    short        0x0a2a        (LNKARRAY)
  1683. >8    short        0x2c2a        (STRING)
  1684. >8    short        0x4e2a        (HXS)
  1685. >8    short        0x742a        (LIST)
  1686. >8    short        0x962a        (DIR)
  1687. >8    short        0xb82a        (ALG)
  1688. >8    short        0xda2a        (UNIT)
  1689. >8    short        0xfc2a        (TAGGED)
  1690. >8    short        0x1e2b        (GROB)
  1691. >8    short        0x402b        (LIB)
  1692. >8    short        0x622b        (BACKUP)
  1693. >8    short        0x882b        (LIBDATA)
  1694. >8    short        0x9d2d        (PROG)
  1695. >8    short        0xcc2d        (CODE)
  1696. >8    short        0x482e        (GNAME)
  1697. >8    short        0x6d2e        (LNAME)
  1698. >8    short        0x922e        (XLIB)
  1699. 0    string        %%HP:        HP48 text
  1700. >6    string        T(0)        - T(0)
  1701. >6    string        T(1)        - T(1)
  1702. >6    string        T(2)        - T(2)
  1703. >6    string        T(3)        - T(3)
  1704. >10    string        A(D)        A(D)
  1705. >10    string        A(R)        A(R)
  1706. >10    string        A(G)        A(G)
  1707. >14    string        F(.)        F(.);
  1708. >14    string        F(,)        F(,);
  1709.  
  1710. # hpBSD magic numbers
  1711. 0    beshort        200        hp200 (68010) BSD
  1712. >2    beshort        0407        impure binary
  1713. >2    beshort        0410        read-only binary
  1714. >2    beshort        0413        demand paged binary
  1715. 0    beshort        300        hp300 (68020+68881) BSD
  1716. >2    beshort        0407        impure binary
  1717. >2    beshort        0410        read-only binary
  1718. >2    beshort        0413        demand paged binary
  1719.  
  1720. #------------------------------------------------------------------------------
  1721. # ibm370:  file(1) magic for IBM 370 and compatibles.
  1722. #
  1723. # "ibm370" said that 0x15d == 0535 was "ibm 370 pure executable".
  1724. # What the heck *is* "USS/370"?
  1725. # AIX 4.1's "/etc/magic" has
  1726. #
  1727. #    0    short        0535        370 sysV executable 
  1728. #    >12    long        >0        not stripped
  1729. #    >22    short        >0        - version %d
  1730. #    >30    long        >0        - 5.2 format
  1731. #    0    short        0530        370 sysV pure executable 
  1732. #    >12    long        >0        not stripped
  1733. #    >22    short        >0        - version %d
  1734. #    >30    long        >0        - 5.2 format
  1735. #
  1736. # instead of the "USS/370" versions of the same magic numbers.
  1737. #
  1738. 0    beshort        0537        370 XA sysV executable 
  1739. >12    belong        >0        not stripped
  1740. >22    beshort        >0        - version %d
  1741. >30    belong        >0        - 5.2 format
  1742. 0    beshort        0532        370 XA sysV pure executable 
  1743. >12    belong        >0        not stripped
  1744. >22    beshort        >0        - version %d
  1745. >30    belong        >0        - 5.2 format
  1746. 0    beshort        054001        370 sysV pure executable
  1747. >12    belong        >0        not stripped
  1748. 0    beshort        055001        370 XA sysV pure executable
  1749. >12    belong        >0        not stripped
  1750. 0    beshort        056401        370 sysV executable
  1751. >12    belong        >0        not stripped
  1752. 0    beshort        057401        370 XA sysV executable
  1753. >12    belong        >0        not stripped
  1754. 0       beshort        0531        SVR2 executable (Amdahl-UTS)
  1755. >12    belong        >0        not stripped
  1756. >24     belong        >0        - version %ld
  1757. 0    beshort        0534        SVR2 pure executable (Amdahl-UTS)
  1758. >12    belong        >0        not stripped
  1759. >24    belong        >0        - version %ld
  1760. 0    beshort        0530        SVR2 pure executable (USS/370)
  1761. >12    belong        >0        not stripped
  1762. >24    belong        >0        - version %ld
  1763. 0    beshort        0535        SVR2 executable (USS/370)
  1764. >12    belong        >0        not stripped
  1765. >24    belong        >0        - version %ld
  1766.  
  1767. #------------------------------------------------------------------------------
  1768. # ibm6000:  file(1) magic for RS/6000 and the RT PC.
  1769. #
  1770. 0    beshort        0x01df        executable (RISC System/6000 V3.1) or obj module
  1771. >12    belong        >0        not stripped
  1772. # Breaks sun4 statically linked execs.
  1773. #0      beshort        0x0103        executable (RT Version 2) or obj module
  1774. #>2    byte        0x50        pure
  1775. #>28    belong        >0        not stripped
  1776. #>6    beshort        >0        - version %ld
  1777. 0    beshort        0x0104        shared library
  1778. 0    beshort        0x0105        ctab data
  1779. 0    beshort        0xfe04        structured file
  1780. 0    string        0xabcdef    AIX message catalog
  1781. 0    belong        0x000001f9    AIX compiled message catalog
  1782. 0    string        \<aiaff>    archive
  1783.  
  1784. #------------------------------------------------------------------------------
  1785. # iff:    file(1) magic for Interchange File Format (see also "audio" & "images")
  1786. #
  1787. # Daniel Quinlan (quinlan@yggdrasil.com) -- IFF was designed by Electronic
  1788. # Arts for file interchange.  It has also been used by Apple, SGI, and
  1789. # especially Commodore-Amiga.
  1790. #
  1791. # IFF files begin with an 8 byte FORM header, followed by a 4 character
  1792. # FORM type, which is followed by the first chunk in the FORM.
  1793.  
  1794. 0    string        FORM        IFF data
  1795. #>4    belong        x        \b, FORM is %d bytes long
  1796. # audio formats
  1797. >8    string        AIFF        \b, AIFF audio
  1798. >8    string        AIFC        \b, AIFF-C compressed audio
  1799. >8    string        8SVX        \b, 8SVX 8-bit sampled sound voice
  1800. >8    string        SAMP        \b, SAMP sampled audio
  1801. # image formats
  1802. >8    string        ILBMBMHD    \b, ILBM interleaved image
  1803. >>20    beshort        x        \b, %d x
  1804. >>22    beshort        x        %d
  1805. >8    string        RGBN        \b, RGBN 12-bit RGB image
  1806. >8    string        RGB8        \b, RGB8 24-bit RGB image
  1807. >8    string        DR2D        \b, DR2D 2-D object
  1808. >8    string        TDDD        \b, TDDD 3-D rendering
  1809. # other formats
  1810. >8    string        FTXT        \b, FTXT formatted text
  1811.  
  1812. #------------------------------------------------------------------------------
  1813. # images:  file(1) magic for image formats (see also "iff")
  1814. #
  1815. # originally from jef@helios.ee.lbl.gov (Jef Poskanzer),
  1816. # additions by janl@ifi.uio.no as well as others. Jan also suggested
  1817. # merging several one- and two-line files into here.
  1818. #
  1819. # little magic: PCX (first byte is 0x0a)
  1820. # no magic: Targa
  1821.  
  1822. # PBMPLUS images
  1823. # The next byte following the magic is always whitespace.
  1824. 0    string        P1        PBM image text
  1825. 0    string        P2        PGM image text
  1826. 0    string        P3        PPM image text
  1827. 0    string        P4        PBM "rawbits" image data
  1828. 0    string        P5        PGM "rawbits" image data
  1829. 0    string        P6        PPM "rawbits" image data
  1830.  
  1831. # NIFF (Navy Interchange File Format, a modification of TIFF) images
  1832. 0    string        IIN1        NIFF image data
  1833.  
  1834. # Tag Image File Format, from Daniel Quinlan (quinlan@yggdrasil.com)
  1835. # The second word of TIFF files is the TIFF version number, 42, which has
  1836. # never changed.  The TIFF specification recommends testing for it.
  1837. 0    string        MM\x00\x2a    TIFF image data, big-endian
  1838. 0    string        II\x2a\x00    TIFF image data, little-endian
  1839.  
  1840. # PNG [Portable Network Graphics, or "PNG's Not GIF"] images
  1841. # (Greg Roelofs, newt@uchicago.edu)
  1842. # (Albert Cahalan, acahalan@cs.uml.edu)
  1843. #
  1844. # 137 P N G \r \n ^Z \n [4-byte length] H E A D [HEAD data] [HEAD crc] ...
  1845. #
  1846. 0    string        \x89PNG        PNG image data,
  1847. >4    belong        !0x0d0a1a0a    CORRUPTED,
  1848. >4    belong        0x0d0a1a0a
  1849. >>16    belong        x        %ld x
  1850. >>20    belong        x        %ld,
  1851. >>24    byte        x        %d-bit
  1852. >>25    byte        0        grayscale,
  1853. >>25    byte        2        \b/color RGB,
  1854. >>25    byte        3        colormap,
  1855. >>25    byte        4        gray+alpha,
  1856. >>25    byte        6        \b/color RGBA,
  1857. #>>26    byte        0        deflate/32K,
  1858. >>28    byte        0        non-interlaced
  1859. >>28    byte        1        interlaced
  1860. 1    string        PNG        PNG image data, CORRUPTED
  1861.  
  1862. # GIF
  1863. 0    string        GIF8        GIF image data
  1864. >4    string        7a        \b, version 8%s,
  1865. >4    string        9a        \b, version 8%s,
  1866. >6    leshort        >0        %hd x
  1867. >8    leshort        >0        %hd,
  1868. #>10    byte        &0x80        color mapped,
  1869. #>10    byte&0x07    =0x00        2 colors
  1870. #>10    byte&0x07    =0x01        4 colors
  1871. #>10    byte&0x07    =0x02        8 colors
  1872. #>10    byte&0x07    =0x03        16 colors
  1873. #>10    byte&0x07    =0x04        32 colors
  1874. #>10    byte&0x07    =0x05        64 colors
  1875. #>10    byte&0x07    =0x06        128 colors
  1876. #>10    byte&0x07    =0x07        256 colors
  1877.  
  1878. # ITC (CMU WM) raster files.  It is essentially a byte-reversed Sun raster,
  1879. # 1 plane, no encoding.
  1880. 0    string        \361\0\100\273    CMU window manager raster image data
  1881. >4    lelong        >0        %d x
  1882. >8    lelong        >0        %d,
  1883. >12    lelong        >0        %d-bit
  1884.  
  1885. # Magick Image File Format
  1886. 0    string        id=ImageMagick    MIFF image data
  1887.  
  1888. # Artisan
  1889. 0    long        1123028772    Artisan image data
  1890. >4    long        1        \b, rectangular 24-bit
  1891. >4    long        2        \b, rectangular 8-bit with colormap
  1892. >4    long        3        \b, rectangular 32-bit (24-bit with matte)
  1893.  
  1894. # FIG (Facility for Interactive Generation of figures), an object-based format
  1895. 0    string        #FIG        FIG image text
  1896. >5    string        x        \b, version %.3s
  1897.  
  1898. # PHIGS
  1899. 0    string        ARF_BEGARF        PHIGS clear text archive
  1900. 0    string        @(#)SunPHIGS        SunPHIGS
  1901. # version number follows, in the form m.n
  1902. >40    string        SunBin            binary
  1903. >32    string        archive            archive
  1904.  
  1905. # GKS (Graphics Kernel System)
  1906. 0    string        GKSM        GKS Metafile
  1907. >24    string        SunGKS        \b, SunGKS
  1908.  
  1909. # CGM image files
  1910. 0    string        BEGMF        clear text Computer Graphics Metafile
  1911. # XXX - questionable magic
  1912. 0    beshort&0xffe0    0x0020        binary Computer Graphics Metafile
  1913. 0    beshort        0x3020        character Computer Graphics Metafile
  1914.  
  1915. # MGR bitmaps  (Michael Haardt, u31b3hs@pool.informatik.rwth-aachen.de)
  1916. 0    string    yz    MGR bitmap, modern format, 8-bit aligned
  1917. 0    string    zz    MGR bitmap, old format, 1-bit deep, 16-bit aligned
  1918. 0    string    xz    MGR bitmap, old format, 1-bit deep, 32-bit aligned
  1919. 0    string    yx    MGR bitmap, modern format, squeezed
  1920.  
  1921. # Fuzzy Bitmap (FBM) images
  1922. 0    string        %bitmap\0    FBM image data
  1923. >30    long        0x31        \b, mono
  1924. >30    long        0x33        \b, color
  1925.  
  1926. # facsimile data
  1927. 1    string        PC\ Research,\ Inc    group 3 fax data
  1928. >29    byte        0        \b, normal resolution (204x98 DPI)
  1929. >29    byte        1        \b, fine resolution (204x196 DPI)
  1930.  
  1931. # JPEG images
  1932. # SunOS 5.5.1 had
  1933. #
  1934. #    0    string        \377\330\377\340    JPEG file
  1935. #    0    string        \377\330\377\356    JPG file
  1936. #
  1937. # both of which turn into "JPEG image data" here.
  1938. #
  1939. 0    beshort        0xffd8        JPEG image data
  1940. >6    string        JFIF        \b, JFIF standard
  1941. # HSI is Handmade Software's proprietary JPEG encoding scheme
  1942. 0    string        hsi1        JPEG image data, HSI proprietary
  1943.  
  1944. # PC bitmaps (OS/2, Windoze BMP files)  (Greg Roelofs, newt@uchicago.edu)
  1945. 0    string        BM        PC bitmap data
  1946. >14    leshort        12        \b, OS/2 1.x format
  1947. >>18    leshort        x        \b, %d x
  1948. >>20    leshort        x        %d
  1949. >14    leshort        64        \b, OS/2 2.x format
  1950. >>18    leshort        x        \b, %d x
  1951. >>20    leshort        x        %d
  1952. >14    leshort        40        \b, Windows 3.x format
  1953. >>18    lelong        x        \b, %d x
  1954. >>22    lelong        x        %d x
  1955. >>28    leshort        x        %d
  1956. 0    string        IC        PC icon data
  1957. 0    string        PI        PC pointer image data
  1958. 0    string        CI        PC color icon data
  1959. 0    string        CP        PC color pointer image data
  1960. # Conflicts with other entries [BABYL]
  1961. #0    string        BA        PC bitmap array data
  1962.  
  1963. # XPM icons (Greg Roelofs, newt@uchicago.edu)
  1964. # note possible collision with C/REXX entry in c-lang; currently commented out
  1965. 0    string        /*\ XPM\ */    X pixmap image text
  1966.  
  1967. # Utah Raster Toolkit RLE images (janl@ifi.uio.no)
  1968. 0    leshort        0xcc52        RLE image data,
  1969. >6    leshort        x        %d x
  1970. >8    leshort        x        %d
  1971. >2    leshort        >0        \b, lower left corner: %d
  1972. >4    leshort        >0        \b, lower right corner: %d
  1973. >10    byte&0x1    =0x1        \b, clear first
  1974. >10    byte&0x2    =0x2        \b, no background
  1975. >10    byte&0x4    =0x4        \b, alpha channel
  1976. >10    byte&0x8    =0x8        \b, comment
  1977. >11    byte        >0        \b, %d color channels
  1978. >12    byte        >0        \b, %d bits per pixel
  1979. >13    byte        >0        \b, %d color map channels
  1980.  
  1981. # image file format (Robert Potter, potter@cs.rochester.edu)
  1982. 0    string        Imagefile\ version-    iff image data
  1983. # this adds the whole header (inc. version number), informative but longish
  1984. >10    string        >\0        %s
  1985.  
  1986. # Sun raster images, from Daniel Quinlan (quinlan@yggdrasil.com)
  1987. 0    belong        0x59a66a95    Sun raster image data
  1988. >4    belong        >0        \b, %d x
  1989. >8    belong        >0        %d,
  1990. >12    belong        >0        %d-bit,
  1991. #>16    belong        >0        %d bytes long,
  1992. >20    belong        0        old format,
  1993. #>20    belong        1        standard,
  1994. >20    belong        2        compressed,
  1995. >20    belong        3        RGB,
  1996. >20    belong        4        TIFF,
  1997. >20    belong        5        IFF,
  1998. >20    belong        0xffff        reserved for testing,
  1999. >24    belong        0        no colormap
  2000. >24    belong        1        RGB colormap
  2001. >24    belong        2        raw colormap
  2002. #>28    belong        >0        colormap is %d bytes long
  2003.  
  2004. # SGI image file format, from Daniel Quinlan (quinlan@yggdrasil.com)
  2005. # file://sgi.com/graphics/SGIIMAGESPEC
  2006. 0    beshort        474        SGI image data
  2007. #>2    byte        0        \b, verbatim
  2008. >2    byte        1        \b, RLE
  2009. #>3    byte        1        \b, normal precision
  2010. >3    byte        2        \b, high precision
  2011. >4    beshort        x        \b, %d-D
  2012. >6    beshort        x        \b, %d x
  2013. >8    beshort        x        %d
  2014. >10    beshort        x        \b, %d channel
  2015. >10    beshort        !1        \bs
  2016. >80    string        >0        \b, "%s"
  2017.  
  2018. 0    string        IT01        FIT image data
  2019. >4    belong        x        \b, %d x
  2020. >8    belong        x        %d x
  2021. >12    belong        x        %d
  2022. #
  2023. 0    string        IT02        FIT image data
  2024. >4    belong        x        \b, %d x
  2025. >8    belong        x        %d x
  2026. >12    belong        x        %d
  2027. #
  2028. 2048    string        PCD_IPI        Kodak Photo CD image pack file
  2029. 0    string        PCD_OPA        Kodak Photo CD overview pack file
  2030.  
  2031. # FITS format.  Jeff Uphoff <juphoff@tarsier.cv.nrao.edu>
  2032. # FITS is the Flexible Image Transport System, the de facto standard for
  2033. # data and image transfer, storage, etc., for the astronomical community.
  2034. # (FITS floating point formats are big-endian.)
  2035. 0    string    SIMPLE\ \ =    FITS image data
  2036. >109    string    8        \b, 8-bit, character or unsigned binary integer
  2037. >108    string    16        \b, 16-bit, two's complement binary integer
  2038. >107    string    \ 32        \b, 32-bit, two's complement binary integer
  2039. >107    string    -32        \b, 32-bit, floating point, single precision
  2040. >107    string    -64        \b, 64-bit, floating point, double precision
  2041.  
  2042. # other images
  2043. 0    string    This\ is\ a\ BitMap\ file    Lisp Machine bit-array-file
  2044. 0    string        !!        Bennet Yee's "face" format
  2045.  
  2046. # From SunOS 5.5.1 "/etc/magic" - appeared right before Sun raster image
  2047. # stuff.
  2048. #
  2049. 0    beshort        0x1010        PEX Binary Archive
  2050.  
  2051. # Visio drawings
  2052. 03000    string    Visio\ (TM)\ Drawing            %s
  2053.  
  2054. #------------------------------------------------------------------------------
  2055. # intel:  file(1) magic for x86 Unix
  2056. #
  2057. # Various flavors of x86 UNIX executable/object (other than Xenix, which
  2058. # is in "microsoft").  DOS is in "msdos"; the ambitious soul can do
  2059. # Windows as well.
  2060. #
  2061. # Windows NT belongs elsewhere, as you need x86 and MIPS and Alpha and
  2062. # whatever comes next (HP-PA Hummingbird?).  OS/2 may also go elsewhere
  2063. # as well, if, as, and when IBM makes it portable.
  2064. #
  2065. # The `versions' should be un-commented if they work for you.
  2066. # (Was the problem just one of endianness?)
  2067. #
  2068. 0    leshort        0502        basic-16 executable
  2069. >12    lelong        >0        not stripped
  2070. #>22    leshort        >0        - version %ld
  2071. 0    leshort        0503        basic-16 executable (TV)
  2072. >12    lelong        >0        not stripped
  2073. #>22    leshort        >0        - version %ld
  2074. 0    leshort        0510        x86 executable
  2075. >12    lelong        >0        not stripped
  2076. 0    leshort        0511        x86 executable (TV)
  2077. >12    lelong        >0        not stripped
  2078. 0    leshort        =0512        iAPX 286 executable small model (COFF)
  2079. >12    lelong        >0        not stripped
  2080. #>22    leshort        >0        - version %ld
  2081. 0    leshort        =0522        iAPX 286 executable large model (COFF)
  2082. >12    lelong        >0        not stripped
  2083. #>22    leshort        >0        - version %ld
  2084. # SGI labeled the next entry as "iAPX 386 executable" --Dan Quinlan
  2085. 0    leshort        =0514        80386 COFF executable
  2086. >12    lelong        >0        not stripped
  2087. >22    leshort        >0        - version %ld
  2088.  
  2089. #------------------------------------------------------------------------------
  2090. # interleaf:  file(1) magic for InterLeaf TPS:
  2091. #
  2092. 0    string        =\210OPS    Interleaf saved data
  2093. 0    string        =<!OPS        Interleaf document text
  2094. >5    string        ,\ Version\ =    \b, version
  2095. >>17    string        >\0        %.3s
  2096.  
  2097. #------------------------------------------------------------------------------
  2098. # island:  file(1) magic for IslandWite/IslandDraw, from SunOS 5.5.1
  2099. # "/etc/magic":
  2100. # From: guy@netapp.com (Guy Harris)
  2101. #
  2102. 4    string        pgscriptver    IslandWrite document
  2103. 13    string        DrawFile    IslandDraw document
  2104.  
  2105.  
  2106. #------------------------------------------------------------------------------
  2107. # ispell:  file(1) magic for ispell
  2108. #
  2109. # Ispell 3.0 has a magic of 0x9601 and ispell 3.1 has 0x9602.  This magic
  2110. # will match 0x9600 through 0x9603 in *both* little endian and big endian.
  2111. # (No other current magic entries collide.)
  2112. #
  2113. # Updated by Daniel Quinlan (quinlan@yggdrasil.com)
  2114. #
  2115. 0    leshort&0xFFFC    0x9600        little endian ispell
  2116. >0    byte        0        hash file (?),
  2117. >0    byte        1        3.0 hash file,
  2118. >0    byte        2        3.1 hash file,
  2119. >0    byte        3        hash file (?),
  2120. >2    leshort        0x00        8-bit, no capitalization, 26 flags
  2121. >2    leshort        0x01        7-bit, no capitalization, 26 flags
  2122. >2    leshort        0x02        8-bit, capitalization, 26 flags
  2123. >2    leshort        0x03        7-bit, capitalization, 26 flags
  2124. >2    leshort        0x04        8-bit, no capitalization, 52 flags
  2125. >2    leshort        0x05        7-bit, no capitalization, 52 flags
  2126. >2    leshort        0x06        8-bit, capitalization, 52 flags
  2127. >2    leshort        0x07        7-bit, capitalization, 52 flags
  2128. >2    leshort        0x08        8-bit, no capitalization, 128 flags
  2129. >2    leshort        0x09        7-bit, no capitalization, 128 flags
  2130. >2    leshort        0x0A        8-bit, capitalization, 128 flags
  2131. >2    leshort        0x0B        7-bit, capitalization, 128 flags
  2132. >2    leshort        0x0C        8-bit, no capitalization, 256 flags
  2133. >2    leshort        0x0D        7-bit, no capitalization, 256 flags
  2134. >2    leshort        0x0E        8-bit, capitalization, 256 flags
  2135. >2    leshort        0x0F        7-bit, capitalization, 256 flags
  2136. >4    leshort        >0        and %d string characters
  2137. 0    beshort&0xFFFC    0x9600        big endian ispell
  2138. >1    byte        0        hash file (?),
  2139. >1    byte        1        3.0 hash file,
  2140. >1    byte        2        3.1 hash file,
  2141. >1    byte        3        hash file (?),
  2142. >2    beshort        0x00        8-bit, no capitalization, 26 flags
  2143. >2    beshort        0x01        7-bit, no capitalization, 26 flags
  2144. >2    beshort        0x02        8-bit, capitalization, 26 flags
  2145. >2    beshort        0x03        7-bit, capitalization, 26 flags
  2146. >2    beshort        0x04        8-bit, no capitalization, 52 flags
  2147. >2    beshort        0x05        7-bit, no capitalization, 52 flags
  2148. >2    beshort        0x06        8-bit, capitalization, 52 flags
  2149. >2    beshort        0x07        7-bit, capitalization, 52 flags
  2150. >2    beshort        0x08        8-bit, no capitalization, 128 flags
  2151. >2    beshort        0x09        7-bit, no capitalization, 128 flags
  2152. >2    beshort        0x0A        8-bit, capitalization, 128 flags
  2153. >2    beshort        0x0B        7-bit, capitalization, 128 flags
  2154. >2    beshort        0x0C        8-bit, no capitalization, 256 flags
  2155. >2    beshort        0x0D        7-bit, no capitalization, 256 flags
  2156. >2    beshort        0x0E        8-bit, capitalization, 256 flags
  2157. >2    beshort        0x0F        7-bit, capitalization, 256 flags
  2158. >4    beshort        >0        and %d string characters
  2159. #------------------------------------------------------------
  2160. # Java ByteCode
  2161. # From Larry Schwimmer (schwim@cs.stanford.edu)
  2162. 0    belong        0xcafebabe    compiled Java class data,
  2163. >6    beshort x    version %d.
  2164. >4    beshort x    \b%d
  2165. #------------------------------------------------------------
  2166. # Java serialization
  2167. # From Martin Pool (m.pool@pharos.com.au)
  2168. 0    beshort        0xaced        Java serialization data
  2169. >2    beshort        >0x0004        \b, version %d
  2170.  
  2171. #------------------------------------------------------------------------------
  2172. # karma:  file(1) magic for Karma data files
  2173. #
  2174. # From <rgooch@atnf.csiro.au>
  2175.  
  2176. 0    string        KarmaRHD Version    Karma Data Structure Version
  2177. >16    long        x        %lu
  2178. #------------------------------------------------------------------------------
  2179. # DEC SRC Virtual Paper: Lectern files
  2180. # Karl M. Hegbloom <karlheg@inetarena.com>
  2181. 0    string    lect    DEC SRC Virtual Paper Lectern file
  2182.  
  2183. #------------------------------------------------------------------------------
  2184. # lex:  file(1) magic for lex
  2185. #
  2186. #    derived empirically, your offsets may vary!
  2187. 53    string        yyprevious    C program text (from lex)
  2188. >3    string        >\0         for %s
  2189. # C program text from GNU flex, from Daniel Quinlan <quinlan@yggdrasil.com>
  2190. 21    string        generated\ by\ flex    C program text (from flex)
  2191. # lex description file, from Daniel Quinlan <quinlan@yggdrasil.com>
  2192. 0    string        %{        lex description text
  2193.  
  2194. #------------------------------------------------------------------------------
  2195. # lif:  file(1) magic for lif
  2196. #
  2197. # XXX - byte order?  (Probably beshort, Daniel Quinlan <quinlan@yggdrasil.com>)
  2198. #
  2199. 0    short        0x8000        lif file
  2200.  
  2201. #------------------------------------------------------------------------------
  2202. # linux:  file(1) magic for Linux files
  2203. #
  2204. # Values for Linux/i386 binaries, from Daniel Quinlan <quinlan@yggdrasil.com>
  2205. # The following basic Linux magic is useful for reference, but using
  2206. # "long" magic is a better practice in order to avoid collisions.
  2207. #
  2208. # 2    leshort        100        Linux/i386
  2209. # >0    leshort        0407        impure executable (OMAGIC)
  2210. # >0    leshort        0410        pure executable (NMAGIC)
  2211. # >0    leshort        0413        demand-paged executable (ZMAGIC)
  2212. # >0    leshort        0314        demand-paged executable (QMAGIC)
  2213. #
  2214. 0    lelong        0x00640107    Linux/i386 impure executable (OMAGIC)
  2215. >16    lelong        0        \b, stripped
  2216. 0    lelong        0x00640108    Linux/i386 pure executable (NMAGIC)
  2217. >16    lelong        0        \b, stripped
  2218. 0    lelong        0x0064010b    Linux/i386 demand-paged executable (ZMAGIC)
  2219. >16    lelong        0        \b, stripped
  2220. 0    lelong        0x006400cc    Linux/i386 demand-paged executable (QMAGIC)
  2221. >16    lelong        0        \b, stripped
  2222. #
  2223. 0    string        \007\001\000    Linux/i386 object file
  2224. >20    lelong        >0x1020        \b, DLL library
  2225. # message catalogs, from Mitchum DSouza <m.dsouza@mrc-apu.cam.ac.uk>
  2226. 0    string        *nazgul*    Linux compiled message catalog
  2227. >8    lelong        >0        \b, version %ld
  2228. # core dump file, from Bill Reynolds <bill@goshawk.lanl.gov>
  2229. 216    lelong        0421        Linux/i386 core file
  2230. >220    string        >\0        of '%s'
  2231. >200    lelong        >0        (signal %d)
  2232. #
  2233. # LILO boot/chain loaders, from Daniel Quinlan <quinlan@yggdrasil.com>
  2234. # this can be overridden by the DOS executable (COM) entry
  2235. 2    string        LILO        Linux/i386 LILO boot/chain loader
  2236. #
  2237. # Debian Packages, from Peter Tobias <tobias@server.et-inf.fho-emden.de>
  2238. 0    string        0.9
  2239. >8    byte        0x0a        old Debian Binary Package
  2240. >>3    byte        >0        \b, created by dpkg 0.9%c
  2241. >>4    byte        >0        pl%c
  2242. # PSF fonts, from H. Peter Anvin <hpa@yggdrasil.com>
  2243. 0    leshort        0x0436        Linux/i386 PC Screen Font data,
  2244. >2    byte        0        256 characters, no directory,
  2245. >2    byte        1        512 characters, no directory,
  2246. >2    byte        2        256 characters, Unicode directory,
  2247. >2    byte        3        512 characters, Unicode directory,
  2248. >3    byte        >0        8x%d
  2249. # Linux swap file, from Daniel Quinlan <quinlan@yggdrasil.com>
  2250. 4086    string        SWAP-SPACE    Linux/i386 swap file
  2251. # ECOFF magic for OSF/1 and Linux (only tested under Linux though)
  2252. #
  2253. #    from Erik Troan (ewt@redhat.com) examining od dumps, so this
  2254. #        could be wrong
  2255. #      updated by David Mosberger (davidm@azstarnet.com) based on
  2256. #      GNU BFD and MIPS info found below.
  2257. #
  2258. 0    leshort        0x0183        ECOFF alpha
  2259. >24    leshort        0407        executable
  2260. >24    leshort        0410        pure
  2261. >24    leshort        0413        demand paged
  2262. >8    long        >0        not stripped
  2263. >8    long        0        stripped
  2264. >23    leshort        >0        - version %ld.
  2265. #
  2266. # Linux kernel boot images, from Albert Cahalan <acahalan@cs.uml.edu>
  2267. # and others such as Axel Kohlmeyer <akohlmey@rincewind.chemie.uni-ulm.de>
  2268. # and Nicolas Lichtmaier <nick@debian.org>
  2269. # All known start with: b8 c0 07 8e d8 b8 00 90 8e c0 b9 00 01 29 f6 29
  2270. 514        string    HdrS        Linux kernel
  2271. >518        leshort    >0
  2272. >>529        byte    0        zImage data,
  2273. >>529        byte    1        bzImage data,
  2274. >0x048c        byte    0x31
  2275. >>0x048c    string    x        version %s
  2276. >0x0493        byte    0x31
  2277. >>0x0493    string    x        version %s
  2278. >0x048c        byte    0x32
  2279. >>0x048c    string    x        version %s
  2280. >0x0493        byte    0x32
  2281. >>0x0493    string    x        version %s
  2282. >0x04df        byte    0x32
  2283. >>0x04df    string    x        version %s
  2284. >0x04fb        byte    0x32
  2285. >>0x04fb    string    x        version %s
  2286. # This also matches new kernels, which were caught above by "HdrS".
  2287. 0        belong    0xb8c0078e    Linux kernel
  2288. >0x1e3        string    Loading        version 1.3.79 or older
  2289. >0x1e9        string    Loading        from prehistoric times
  2290. # LSM entries - Nicolas Lichtmaier <nick@feedback.com.ar>
  2291. 0    string    Begin3    Linux Software Map entry text
  2292.  
  2293. #------------------------------------------------------------------------------
  2294. # lisp:  file(1) magic for lisp programs
  2295. #
  2296. # various lisp types, from Daniel Quinlan (quinlan@yggdrasil.com)
  2297. 0    string    ;;            Lisp/Scheme program text
  2298. # Emacs 18 - this is always correct, but not very magical.
  2299. 0    string    \012(            byte-compiled Emacs-Lisp program data
  2300. # Emacs 19
  2301. 0    string    ;ELC\023\000\000\000    byte-compiled Emacs-Lisp program data
  2302. #
  2303. # Files produced by CLISP Common Lisp From: Bruno Haible <haible@ilog.fr>
  2304. 0    string    (SYSTEM::VERSION\040'    CLISP byte-compiled Lisp program text
  2305. 0    long    0x70768BD2        CLISP memory image data
  2306. 0    long    0xD28B7670        CLISP memory image data, other endian
  2307. # Files produced by GNU gettext
  2308. 0    long    0xDE120495        GNU-format message catalog data
  2309. 0    long    0x950412DE        GNU-format message catalog data
  2310. #------------------------------------------------------------------------------
  2311. # mach file description
  2312. #
  2313. 0    belong        0xcafebabe    mach-o fat file
  2314. >4    belong        1        with 1 architecture
  2315. >4    belong        >1
  2316. >>4    belong        x        with %ld architectures        
  2317. #
  2318. 0    belong        0xfeedface    mach-o
  2319. >12    belong        1        object
  2320. >12    belong        2        executable
  2321. >12    belong        3        shared library
  2322. >12    belong        4        core
  2323. >12    belong        5        preload executable
  2324. >12    belong        >5
  2325. >>12    belong        x        filetype=%ld
  2326. >4    belong        <0
  2327. >>4    belong        x        architecture=%ld
  2328. >4    belong        1        vax
  2329. >4    belong        2        romp
  2330. >4    belong        3        architecture=3
  2331. >4    belong        4        ns32032
  2332. >4    belong        5        ns32332
  2333. >4    belong        6        for m68k architecture
  2334. >4    belong        7        i386
  2335. >4    belong        8        mips
  2336. >4    belong        9        ns32532
  2337. >4    belong        10        architecture=10
  2338. >4    belong        11        hp pa-risc
  2339. >4    belong        12        acorn
  2340. >4    belong        13        m88k
  2341. >4    belong        14        sparc
  2342. >4    belong        15        i860-big
  2343. >4    belong        16        i860
  2344. >4    belong        17        rs6000
  2345. >4    belong        18        powerPC
  2346. >4    belong        >18
  2347. >>4    belong        x        architecture=%ld
  2348.  
  2349. #------------------------------------------------------------------------------
  2350. # macintosh description
  2351. #
  2352. # BinHex is the Macintosh ASCII-encoded file format (see also "apple")
  2353. # Daniel Quinlan, quinlan@yggdrasil.com
  2354. 11    string    must\ be\ converted\ with\ BinHex    BinHex binary text
  2355. >41    string    x                    \b, version %.3s
  2356.  
  2357. # Stuffit archives are the de facto standard of compression for Macintosh
  2358. # files obtained from most archives. (franklsm@tuns.ca)
  2359. 0    string        SIT!            StuffIt Archive (data)
  2360. >2    string        x            : %s
  2361. 65    string        SIT!            StuffIt Archive (rsrc + data)
  2362. >2    string        x            : %s
  2363. 0    string        SITD            StuffIt Deluxe (data)
  2364. >2    string        x            : %s
  2365. 65    string        SITD            StuffIt Deluxe (rsrc + data)
  2366. >2    string        x            : %s
  2367. 0    string        Seg            StuffIt Deluxe Segment (data)
  2368. >2    string        x            : %s
  2369. 65    string        Seg            StuffIt Deluxe Segment (rsrc + data)
  2370. >2    string        x            : %s
  2371.  
  2372. # Macintosh Applications and Installation binaries (franklsm@tuns.ca)
  2373. 0    string        APPL            Macintosh Application (data)
  2374. >2    string        x            : %s
  2375. 65    string        APPL            Macintosh Application (rsrc + data)
  2376. >2    string        x            : %s
  2377.  
  2378. # Macintosh System files (franklsm@tuns.ca)
  2379. 0    string        zsys            Macintosh System File (data)
  2380. 65    string        zsys            Macintosh System File(rsrc + data)
  2381. 0    string        FNDR            Macintosh Finder (data)
  2382. 65    string        FNDR            Macintosh Finder(rsrc + data)
  2383. 0    string        libr            Macintosh Library (data)
  2384. >2    string        x            : %s
  2385. 65    string        libr            Macintosh Library(rsrc + data)
  2386. >2    string        x            : %s
  2387. 0    string        shlb            Macintosh Shared Library (data)
  2388. >2    string        x            : %s
  2389. 65    string        shlb            Macintosh Shared Library(rsrc + data)
  2390. >2    string        x            : %s
  2391. 0    string        cdev            Macintosh Control Panel (data)
  2392. >2    string        x            : %s
  2393. 65    string        cdev            Macintosh Control Panel(rsrc + data)
  2394. >2    string        x            : %s
  2395. 0    string        INIT            Macintosh Extension (data)
  2396. >2    string        x            : %s
  2397. 65    string        INIT            Macintosh Extension(rsrc + data)
  2398. >2    string        x            : %s
  2399. 0    string        FFIL            Macintosh Truetype Font (data)
  2400. >2    string        x            : %s
  2401. 65    string        FFIL            Macintosh Truetype Font(rsrc + data)
  2402. >2    string        x            : %s
  2403. 0    string        LWFN            Macintosh Postscript Font (data)
  2404. >2    string        x            : %s
  2405. 65    string        LWFN            Macintosh Postscript Font(rsrc + data)
  2406. >2    string        x            : %s
  2407.  
  2408. # Additional Macintosh Files (franklsm@tuns.ca)
  2409.  
  2410. 0    string        PACT            Macintosh Compact Pro Archive (data)
  2411. >2    string        x            : %s
  2412. 65    string        PACT            Macintosh Compact Pro Archive(rsrc + data)
  2413. >2    string        x            : %s
  2414. 0    string        ttro            Macintosh TeachText File (data)
  2415. >2    string        x            : %s
  2416. 65    string        ttro            Macintosh TeachText File(rsrc + data)
  2417. >2    string        x            : %s
  2418. 0    string        TEXT            Macintosh TeachText File (data)
  2419. >2    string        x            : %s
  2420. 65    string        TEXT            Macintosh TeachText File(rsrc + data)
  2421. >2    string        x            : %s
  2422. 0    string        PDF            Macintosh PDF File (data)
  2423. >2    string        x            : %s
  2424. 65    string        PDF            Macintosh PDF File(rsrc + data)
  2425. >2    string        x            : %s
  2426.  
  2427.  
  2428. #------------------------------------------------------------------------------
  2429. # magic:  file(1) magic for magic files
  2430. #
  2431. 0    string        #\ Magic    magic text file for file(1) cmd
  2432.  
  2433. #------------------------------------------------------------------------------
  2434. # mail.news:  file(1) magic for mail and news
  2435. #
  2436. # Unfortunately, saved netnews also has From line added in some news software.
  2437. #0    string        From         mail text
  2438. # There are tests to ascmagic.c to cope with mail and news.
  2439. 0    string        Relay-Version:     old news text
  2440. 0    string        #!\ rnews    batched news text
  2441. 0    string        N#!\ rnews    mailed, batched news text
  2442. 0    string        Forward\ to     mail forwarding text
  2443. 0    string        Pipe\ to     mail piping text
  2444. 0    string        Return-Path:    smtp mail text
  2445. 0    string        Path:        news text
  2446. 0    string        Xref:        news text
  2447. 0    string        From:        news or mail text
  2448. 0    string        Article     saved news text
  2449. 0    string        BABYL        Emacs RMAIL text
  2450. 0    string        Received:    RFC 822 mail text
  2451. 0    string        MIME-Version:    MIME entity text
  2452. #0    string        Content-    MIME entity text
  2453. #------------------------------------------------------------------------------
  2454. # mime:  file(1) magic for MIME encoded files
  2455. #
  2456. 0    string        Content-Type:\
  2457. >14    string        >\0        %s
  2458. 0    string        Content-Type:
  2459. >13    string        >\0        %s
  2460.  
  2461. #------------------------------------------------------------------------------
  2462. # mirage:  file(1) magic for Mirage executables
  2463. #
  2464. # XXX - byte order?
  2465. #
  2466. 0    long    31415        Mirage Assembler m.out executable
  2467.  
  2468. #------------------------------------------------------------------------------
  2469. # mkid:  file(1) magic for mkid(1) databases
  2470. #
  2471. # ID is the binary tags database produced by mkid(1).
  2472. #
  2473. # XXX - byte order?
  2474. #
  2475. 0    string        \311\304    ID tags data
  2476. >2    short        >0        version %d
  2477.  
  2478. #------------------------------------------------------------------------------
  2479. # mmdf:  file(1) magic for MMDF mail files
  2480. #
  2481. 0    string    \001\001\001\001    MMDF mailbox
  2482. #------------------------------------------------------------------------------
  2483. # modem:  file(1) magic for modem programs
  2484. #
  2485. # From: Florian La Roche <florian@knorke.saar.de>
  2486. 4    string        Research,    Digifax-G3-File
  2487. >29    byte        1        , fine resolution
  2488. >29    byte        0        , normal resolution
  2489.  
  2490. 0    short        0x0100        raw G3 data, byte-padded
  2491. 0    short        0x1400        raw G3 data
  2492. #
  2493. # Magic data for vgetty voice formats
  2494. # (Martin Seine & Marc Eberhard)
  2495.  
  2496. #
  2497. # raw modem data version 1
  2498. #
  2499. 0    string    RMD1      raw modem data
  2500. >4   string    >\0       (%s /
  2501. >20  short     >0        compression type 0x%04x)
  2502.  
  2503. #
  2504. # portable voice format 1
  2505. #
  2506. 0    string    PVF1\n         portable voice format
  2507. >5   string    >\0       (binary %s)
  2508.  
  2509. #
  2510. # portable voice format 2
  2511. #
  2512. 0    string    PVF2\n         portable voice format
  2513. >5   string >\0          (ascii %s)
  2514.  
  2515.  
  2516. #------------------------------------------------------------------------------
  2517. # motorola:  file(1) magic for Motorola 68K and 88K binaries
  2518. #
  2519. # 68K
  2520. #
  2521. 0    beshort        0520        mc68k COFF
  2522. >18    beshort        ^00000020    object
  2523. >18    beshort        &00000020    executable
  2524. >12    belong        >0        not stripped
  2525. >168    string        .lowmem        Apple toolbox
  2526. >20    beshort        0407        (impure)
  2527. >20    beshort        0410        (pure)
  2528. >20    beshort        0413        (demand paged)
  2529. >20    beshort        0421        (standalone)
  2530. 0    beshort        0521        mc68k executable (shared)
  2531. >12    belong        >0        not stripped
  2532. 0    beshort        0522        mc68k executable (shared demand paged)
  2533. >12    belong        >0        not stripped
  2534. #
  2535. # Motorola/UniSoft 68K Binary Compatibility Standard (BCS)
  2536. #
  2537. 0    beshort        0554        68K BCS executable
  2538. #
  2539. # 88K
  2540. #
  2541. # Motorola/88Open BCS
  2542. #
  2543. 0    beshort        0555        88K BCS executable
  2544. #
  2545. # Motorola S-Records, from Gerd Truschinski <gt@freebsd.first.gmd.de>
  2546. 0   string      S0          Motorola S-Record; binary data in text format
  2547.  
  2548. #------------------------------------------------------------------------------
  2549. # msdos:  file(1) magic for MS-DOS files
  2550. #
  2551.  
  2552. # .BAT files (Daniel Quinlan, quinlan@yggdrasil.com)
  2553. 0    string    @echo\ off    MS-DOS batch file text
  2554.  
  2555. # XXX - according to Microsoft's spec, at an offset of 0x3c in a
  2556. # PE-format executable is the offset in the file of the PE header;
  2557. # unfortunately, that's a little-endian offset, and there's no way
  2558. # to specify an indirect offset with a specified byte order.
  2559. # So, for now, we assume the standard MS-DOS stub, which puts the
  2560. # PE header at 0x80 = 128.
  2561. #
  2562. # Required OS version and subsystem version were 4.0 on some NT 3.51
  2563. # executables built with Visual C++ 4.0, so it's not clear that
  2564. # they're interesting.  The user version was 0.0, but there's
  2565. # probably some linker directive to set it.  The linker version was
  2566. # 3.0, except for one ".exe" which had it as 4.20 (same damn linker!).
  2567. #
  2568. 128    string        PE\0\0    MS Windows PE
  2569. >150    leshort&0x0100    >0    32-bit
  2570. >132    leshort        0x0    unknown processor
  2571. >132    leshort        0x14c    Intel 80386
  2572. >132    leshort        0x166    MIPS R4000
  2573. >132    leshort        0x184    Alpha
  2574. >132    leshort        0x268    Motorola 68000
  2575. >132    leshort        0x1f0    PowerPC
  2576. >132    leshort        0x290    PA-RISC
  2577. >148    leshort        >27
  2578. >>220    leshort        0    unknown subsystem
  2579. >>220    leshort        1    native
  2580. >>220    leshort        2    GUI
  2581. >>220    leshort        3    console
  2582. >>220    leshort        7    POSIX
  2583. >150    leshort&0x2000    =0    executable
  2584. #>>136    ledate        x    stamp %s,
  2585. >>150    leshort&0x0001    >0    not relocatable
  2586. #>>150    leshort&0x0004    =0    with line numbers,
  2587. #>>150    leshort&0x0008    =0    with local symbols,
  2588. #>>150    leshort&0x0200    =0    with debug symbols,
  2589. >>150    leshort&0x1000    >0    system file
  2590. #>>148    leshort        >0
  2591. #>>>154    byte        x    linker %d
  2592. #>>>155    byte        x    \b.%d,
  2593. #>>148    leshort        >27
  2594. #>>>192    leshort        x    requires OS %d
  2595. #>>>194    leshort        x    \b.%d,
  2596. #>>>196    leshort        x    user version %d
  2597. #>>>198    leshort        x    \b.%d,
  2598. #>>>200    leshort        x    subsystem version %d
  2599. #>>>202    leshort        x    \b.%d,
  2600. >150    leshort&0x2000    >0    DLL
  2601. #>>136    ledate        x    stamp %s,
  2602. >>150    leshort&0x0001    >0    not relocatable
  2603. #>>150    leshort&0x0004    =0    with line numbers,
  2604. #>>150    leshort&0x0008    =0    with local symbols,
  2605. #>>150    leshort&0x0200    =0    with debug symbols,
  2606. >>150    leshort&0x1000    >0    system file
  2607. #>>148    leshort        >0
  2608. #>>>154    byte        x    linker %d
  2609. #>>>155    byte        x    \b.%d,
  2610. #>>148    leshort        >27
  2611. #>>>192    leshort        x    requires OS %d
  2612. #>>>194    leshort        x    \b.%d,
  2613. #>>>196    leshort        x    user version %d
  2614. #>>>198    leshort        x    \b.%d,
  2615. #>>>200    leshort        x    subsystem version %d
  2616. #>>>202    leshort        x    \b.%d,
  2617. 0    leshort        0x14c    MS Windows COFF Intel 80386 object file
  2618. #>4    ledate        x    stamp %s
  2619. 0    leshort        0x166    MS Windows COFF MIPS R4000 object file
  2620. #>4    ledate        x    stamp %s
  2621. 0    leshort        0x184    MS Windows COFF Alpha object file
  2622. #>4    ledate        x    stamp %s
  2623. 0    leshort        0x268    MS Windows COFF Motorola 68000 object file
  2624. #>4    ledate        x    stamp %s
  2625. 0    leshort        0x1f0    MS Windows COFF PowerPC object file
  2626. #>4    ledate        x    stamp %s
  2627. 0    leshort        0x290    MS Windows COFF PA-RISC object file
  2628. #>4    ledate        x    stamp %s
  2629.  
  2630. # .EXE formats (Greg Roelofs, newt@uchicago.edu)
  2631. #
  2632. 0    string    MZ        MS-DOS executable (EXE)
  2633. >24    string    @        \b, OS/2 or MS Windows
  2634. >1638    string    -lh5-        \b, LHa SFX archive v2.13S
  2635. >7195    string    Rar!        \b, RAR self-extracting archive
  2636. #
  2637. # [GRR 950118:  file 3.15 has a buffer-size limitation; offsets bigger than
  2638. #   8161 bytes are ignored.  To make the following entries work, increase
  2639. #   HOWMANY in file.h to 32K at least, and maybe to 70K or more for OS/2,
  2640. #   NT/Win32 and VMS.]
  2641. # [GRR:  some company sells a self-extractor/displayer for image data(!)]
  2642. #
  2643. >11696    string    PK\003\004    \b, PKZIP SFX archive v1.1
  2644. >13297    string    PK\003\004    \b, PKZIP SFX archive v1.93a
  2645. >15588    string    PK\003\004    \b, PKZIP2 SFX archive v1.09
  2646. >15770    string    PK\003\004    \b, PKZIP SFX archive v2.04g
  2647. >28374    string    PK\003\004    \b, PKZIP2 SFX archive v1.02
  2648. #
  2649. # Info-ZIP self-extractors
  2650. #    these are the DOS versions:
  2651. >25115    string    PK\003\004    \b, Info-ZIP SFX archive v5.12
  2652. >26331    string    PK\003\004    \b, Info-ZIP SFX archive v5.12 w/decryption
  2653. #    these are the OS/2 versions (OS/2 is flagged above):
  2654. >47031    string    PK\003\004    \b, Info-ZIP SFX archive v5.12
  2655. >49845    string    PK\003\004    \b, Info-ZIP SFX archive v5.12 w/decryption
  2656. #    this is the NT/Win32 version:
  2657. >69120    string    PK\003\004    \b, Info-ZIP NT SFX archive v5.12 w/decryption
  2658. #
  2659. # TELVOX Teleinformatica CODEC self-extractor for OS/2:
  2660. >49801    string    \x79\xff\x80\xff\x76\xff    \b, CODEC archive v3.21
  2661. >>49824    leshort        =1            \b, 1 file
  2662. >>49824    leshort        >1            \b, %u files
  2663.  
  2664. # .COM formats (Daniel Quinlan, quinlan@yggdrasil.com)
  2665. # Uncommenting only the first two lines will cover about 2/3 of COM files,
  2666. # but it isn't feasible to match all COM files since there must be at least
  2667. # two dozen different one-byte "magics".
  2668. #0    byte        0xe9        MS-DOS executable (COM)
  2669. #0    byte        0x8c        MS-DOS executable (COM)
  2670. # 0xeb conflicts with "sequent" magic
  2671. #0    byte        0xeb        MS-DOS executable (COM)
  2672. #0    byte        0xb8        MS-DOS executable (COM)
  2673.  
  2674. # miscellaneous formats
  2675. 0    string        LZ        MS-DOS executable (built-in)
  2676. #0    byte        0xf0        MS-DOS program library data
  2677. #
  2678.  
  2679. #
  2680. # Windows NT Registry files.
  2681. #
  2682. 0    string        regf        Windows NT Registry file
  2683.  
  2684. # Popular applications
  2685. 2080    string    Microsoft\ Word\ 6.0\ Document    %s
  2686. 2080    string    Documento\ Microsoft\ Word\ 6 Spanish Microsoft Word 6 document data
  2687. # Pawel Wiecek <coven@i17linuxb.ists.pwr.wroc.pl> (for polish Word)
  2688. 2112    string    MSWordDoc    Microsoft Word document data
  2689. #
  2690. 0    belong    0x31be0000    Microsoft Word Document
  2691. #
  2692. 0       string  PO^Q`           Microsoft Word 6.0 Document
  2693. #
  2694. 2080    string    Microsoft\ Excel\ 5.0\ Worksheet    %s
  2695. #
  2696. # Pawel Wiecek <coven@i17linuxb.ists.pwr.wroc.pl> (for polish Excel)
  2697. 2114    string    Biff5        Microsoft Excel 5.0 Worksheet
  2698. #
  2699. 0    belong    0x00001a00    Lotus 1-2-3
  2700. >4    belong    0x00100400    wk3 document data
  2701. >4    belong    0x02100400    wk4 document data
  2702. >4    belong    0x07800100    fm3 or fmb document data
  2703. >4    belong    0x07800000    fm3 or fmb document data
  2704. #
  2705. 0    belong    0x00000200     Lotus 1-2-3
  2706. >4    belong    0x06040600    wk1 document data
  2707. >4    belong    0x06800200    fmt document data
  2708.  
  2709. # WordPerfect documents - Trevor Johnson <trevor@jpj.net>
  2710. #
  2711. 1       string          WPC             WordPerfect document
  2712.  
  2713. #------------------------------------------------------------------------------
  2714. # ncr:  file(1) magic for NCR Tower objects
  2715. #
  2716. # contributed by
  2717. # Michael R. Wayne  ***  TMC & Associates  ***  INTERNET: wayne@ford-vax.arpa
  2718. # uucp: {philabs | pyramid} !fmsrl7!wayne   OR   wayne@fmsrl7.UUCP
  2719. #
  2720. 0    beshort        000610    Tower/XP rel 2 object
  2721. >12       belong        >0    not stripped
  2722. >20       beshort        0407    executable
  2723. >20       beshort        0410    pure executable
  2724. >22       beshort        >0    - version %ld
  2725. 0    beshort        000615    Tower/XP rel 2 object
  2726. >12       belong        >0    not stripped
  2727. >20       beshort        0407    executable
  2728. >20       beshort        0410    pure executable
  2729. >22       beshort        >0    - version %ld
  2730. 0    beshort        000620    Tower/XP rel 3 object
  2731. >12       belong        >0    not stripped
  2732. >20       beshort        0407    executable
  2733. >20       beshort        0410    pure executable
  2734. >22       beshort        >0    - version %ld
  2735. 0    beshort        000625    Tower/XP rel 3 object
  2736. >12       belong        >0    not stripped
  2737. >20       beshort        0407    executable
  2738. >20       beshort        0410    pure executable
  2739. >22       beshort        >0    - version %ld
  2740. 0    beshort        000630    Tower32/600/400 68020 object
  2741. >12       belong        >0    not stripped
  2742. >20       beshort        0407    executable
  2743. >20       beshort        0410    pure executable
  2744. >22       beshort        >0    - version %ld
  2745. 0    beshort        000640    Tower32/800 68020
  2746. >18       beshort        &020000    w/68881 object
  2747. >18       beshort        &040000    compatible object
  2748. >18       beshort        &~060000    object
  2749. >20       beshort        0407    executable
  2750. >20       beshort        0413    pure executable
  2751. >12       belong        >0    not stripped
  2752. >22       beshort        >0    - version %ld
  2753. 0    beshort        000645    Tower32/800 68010
  2754. >18       beshort        &040000    compatible object
  2755. >18       beshort        &~060000 object
  2756. >20       beshort        0407    executable
  2757. >20       beshort        0413    pure executable
  2758. >12       belong        >0    not stripped
  2759. >22       beshort        >0    - version %ld
  2760.  
  2761. #------------------------------------------------------------------------------
  2762. # netbsd:  file(1) magic for NetBSD objects
  2763. #
  2764. # All new-style magic numbers are in network byte order.
  2765. #
  2766.  
  2767. 0    lelong            000000407    NetBSD little-endian object file
  2768. >16    lelong            >0        not stripped
  2769. 0    belong            000000407    NetBSD big-endian object file
  2770. >16    belong            >0        not stripped
  2771.  
  2772. 0    belong&0377777777    041400413    NetBSD/i386 demand paged
  2773. >0    byte            &0x80        
  2774. >>20    lelong            <4096        shared library
  2775. >>20    lelong            =4096        dynamically linked executable
  2776. >>20    lelong            >4096        dynamically linked executable
  2777. >0    byte            ^0x80        executable
  2778. >16    lelong            >0        not stripped
  2779. 0    belong&0377777777    041400410    NetBSD/i386 pure
  2780. >0    byte            &0x80        dynamically linked executable
  2781. >0    byte            ^0x80        executable
  2782. >16    lelong            >0        not stripped
  2783. 0    belong&0377777777    041400407    NetBSD/i386
  2784. >0    byte            &0x80        dynamically linked executable
  2785. >0    byte            ^0x80
  2786. >>0    byte            &0x40        position independent
  2787. >>20    lelong            !0        executable
  2788. >>20    lelong            =0        object file
  2789. >16    lelong            >0        not stripped
  2790. 0    belong&0377777777    041400507    NetBSD/i386 core
  2791. >12    string            >\0        from '%s'
  2792.  
  2793. 0    belong&0377777777    041600413    NetBSD/m68k demand paged
  2794. >0    byte            &0x80        
  2795. >>20    belong            <8192        shared library
  2796. >>20    belong            =8192        dynamically linked executable
  2797. >>20    belong            >8192        dynamically linked executable
  2798. >0    byte            ^0x80        executable
  2799. >16    belong            >0        not stripped
  2800. 0    belong&0377777777    041600410    NetBSD/m68k pure
  2801. >0    byte            &0x80        dynamically linked executable
  2802. >0    byte            ^0x80        executable
  2803. >16    belong            >0        not stripped
  2804. 0    belong&0377777777    041600407    NetBSD/m68k
  2805. >0    byte            &0x80        dynamically linked executable
  2806. >0    byte            ^0x80
  2807. >>0    byte            &0x40        position independent
  2808. >>20    belong            !0        executable
  2809. >>20    belong            =0        object file
  2810. >16    belong            >0        not stripped
  2811. 0    belong&0377777777    041600507    NetBSD/m68k core
  2812. >12    string            >\0        from '%s'
  2813.  
  2814. 0    belong&0377777777    042000413    NetBSD/m68k4k demand paged
  2815. >0    byte            &0x80        
  2816. >>20    belong            <4096        shared library
  2817. >>20    belong            =4096        dynamically linked executable
  2818. >>20    belong            >4096        dynamically linked executable
  2819. >0    byte            ^0x80        executable
  2820. >16    belong            >0        not stripped
  2821. 0    belong&0377777777    042000410    NetBSD/m68k4k pure
  2822. >0    byte            &0x80        dynamically linked executable
  2823. >0    byte            ^0x80        executable
  2824. >16    belong            >0        not stripped
  2825. 0    belong&0377777777    042000407    NetBSD/m68k4k
  2826. >0    byte            &0x80        dynamically linked executable
  2827. >0    byte            ^0x80
  2828. >>0    byte            &0x40        position independent
  2829. >>20    belong            !0        executable
  2830. >>20    belong            =0        object file
  2831. >16    belong            >0        not stripped
  2832. 0    belong&0377777777    042000507    NetBSD/m68k4k core
  2833. >12    string            >\0        from '%s'
  2834.  
  2835. 0    belong&0377777777    042200413    NetBSD/ns32532 demand paged
  2836. >0    byte            &0x80        
  2837. >>20    lelong            <4096        shared library
  2838. >>20    lelong            =4096        dynamically linked executable
  2839. >>20    lelong            >4096        dynamically linked executable
  2840. >0    byte            ^0x80        executable
  2841. >16    lelong            >0        not stripped
  2842. 0    belong&0377777777    042200410    NetBSD/ns32532 pure
  2843. >0    byte            &0x80        dynamically linked executable
  2844. >0    byte            ^0x80        executable
  2845. >16    lelong            >0        not stripped
  2846. 0    belong&0377777777    042200407    NetBSD/ns32532
  2847. >0    byte            &0x80        dynamically linked executable
  2848. >0    byte            ^0x80
  2849. >>0    byte            &0x40        position independent
  2850. >>20    lelong            !0        executable
  2851. >>20    lelong            =0        object file
  2852. >16    lelong            >0        not stripped
  2853. 0    belong&0377777777    042200507    NetBSD/ns32532 core
  2854. >12    string            >\0        from '%s'
  2855.  
  2856. 0    belong&0377777777    042400413    NetBSD/sparc demand paged
  2857. >0    byte            &0x80        
  2858. >>20    belong            <8192        shared library
  2859. >>20    belong            =8192        dynamically linked executable
  2860. >>20    belong            >8192        dynamically linked executable
  2861. >0    byte            ^0x80        executable
  2862. >16    belong            >0        not stripped
  2863. 0    belong&0377777777    042400410    NetBSD/sparc pure
  2864. >0    byte            &0x80        dynamically linked executable
  2865. >0    byte            ^0x80        executable
  2866. >16    belong            >0        not stripped
  2867. 0    belong&0377777777    042400407    NetBSD/sparc
  2868. >0    byte            &0x80        dynamically linked executable
  2869. >0    byte            ^0x80
  2870. >>0    byte            &0x40        position independent
  2871. >>20    belong            !0        executable
  2872. >>20    belong            =0        object file
  2873. >16    belong            >0        not stripped
  2874. 0    belong&0377777777    042400507    NetBSD/sparc core
  2875. >12    string            >\0        from '%s'
  2876.  
  2877. 0    belong&0377777777    042600413    NetBSD/pmax demand paged
  2878. >0    byte            &0x80        
  2879. >>20    lelong            <4096        shared library
  2880. >>20    lelong            =4096        dynamically linked executable
  2881. >>20    lelong            >4096        dynamically linked executable
  2882. >0    byte            ^0x80        executable
  2883. >16    lelong            >0        not stripped
  2884. 0    belong&0377777777    042600410    NetBSD/pmax pure
  2885. >0    byte            &0x80        dynamically linked executable
  2886. >0    byte            ^0x80        executable
  2887. >16    lelong            >0        not stripped
  2888. 0    belong&0377777777    042600407    NetBSD/pmax
  2889. >0    byte            &0x80        dynamically linked executable
  2890. >0    byte            ^0x80
  2891. >>0    byte            &0x40        position independent
  2892. >>20    lelong            !0        executable
  2893. >>20    lelong            =0        object file
  2894. >16    lelong            >0        not stripped
  2895. 0    belong&0377777777    042600507    NetBSD/pmax core
  2896. >12    string            >\0        from '%s'
  2897.  
  2898. 0    belong&0377777777    043000413    NetBSD/vax demand paged
  2899. >0    byte            &0x80        
  2900. >>20    lelong            <4096        shared library
  2901. >>20    lelong            =4096        dynamically linked executable
  2902. >>20    lelong            >4096        dynamically linked executable
  2903. >0    byte            ^0x80        executable
  2904. >16    lelong            >0        not stripped
  2905. 0    belong&0377777777    043000410    NetBSD/vax pure
  2906. >0    byte            &0x80        dynamically linked executable
  2907. >0    byte            ^0x80        executable
  2908. >16    lelong            >0        not stripped
  2909. 0    belong&0377777777    043000407    NetBSD/vax
  2910. >0    byte            &0x80        dynamically linked executable
  2911. >0    byte            ^0x80
  2912. >>0    byte            &0x40        position independent
  2913. >>20    lelong            !0        executable
  2914. >>20    lelong            =0        object file
  2915. >16    lelong            >0        not stripped
  2916. 0    belong&0377777777    043000507    NetBSD/vax core
  2917. >12    string            >\0        from '%s'
  2918.  
  2919. # NetBSD/alpha does not support (and has never supported) a.out objects,
  2920. # so no rules are provided for them.  NetBSD/alpha ELF objects are 
  2921. # dealt with in "elf".
  2922. 0    lelong        0x00070185        ECOFF NetBSD/alpha binary
  2923. >10    leshort        0x0001            not stripped
  2924. >10    leshort        0x0000            stripped
  2925. 0    belong&0377777777    043200507    NetBSD/alpha core
  2926. >12    string            >\0        from '%s'
  2927.  
  2928. 0    belong&0377777777    043400413    NetBSD/mips demand paged
  2929. >0    byte            &0x80        
  2930. >>20    belong            <8192        shared library
  2931. >>20    belong            =8192        dynamically linked executable
  2932. >>20    belong            >8192        dynamically linked executable
  2933. >0    byte            ^0x80        executable
  2934. >16    belong            >0        not stripped
  2935. 0    belong&0377777777    043400410    NetBSD/mips pure
  2936. >0    byte            &0x80        dynamically linked executable
  2937. >0    byte            ^0x80        executable
  2938. >16    belong            >0        not stripped
  2939. 0    belong&0377777777    043400407    NetBSD/mips
  2940. >0    byte            &0x80        dynamically linked executable
  2941. >0    byte            ^0x80
  2942. >>0    byte            &0x40        position independent
  2943. >>20    belong            !0        executable
  2944. >>20    belong            =0        object file
  2945. >16    belong            >0        not stripped
  2946. 0    belong&0377777777    043400507    NetBSD/mips core
  2947. >12    string            >\0        from '%s'
  2948.  
  2949. 0    belong&0377777777    043600413    NetBSD/arm32 demand paged
  2950. >0    byte            &0x80
  2951. >>20    lelong            <8192        shared library
  2952. >>20    lelong            =8192        dynamically linked executable
  2953. >>20    lelong            >8192        dynamically linked executable
  2954. >0    byte            ^0x80        executable
  2955. >16    lelong            >0        not stripped
  2956. 0    belong&0377777777    043600410    NetBSD/arm32 pure
  2957. >0    byte            &0x80        dynamically linked executable
  2958. >0    byte            ^0x80        executable
  2959. >16    lelong            >0        not stripped
  2960. 0    belong&0377777777    043600407    NetBSD/arm32
  2961. >0    byte            &0x80        dynamically linked executable
  2962. >0    byte            ^0x80
  2963. >>0    byte            &0x40        position independent
  2964. >>20    lelong            !0        executable
  2965. >>20    lelong            =0        object file
  2966. >16    lelong            >0        not stripped
  2967. 0    belong&0377777777    043600507    NetBSD/arm32 core
  2968. >12    string            >\0        from '%s'
  2969.  
  2970. #------------------------------------------------------------------------------
  2971. # news:  file(1) magic for SunOS NeWS fonts (not "news" as in "netnews")
  2972. #
  2973. 0    string        StartFontMetrics    ASCII font metrics
  2974. 0    string        StartFont    ASCII font bits
  2975. 0    belong        0x137A2944    NeWS bitmap font
  2976. 0    belong        0x137A2947    NeWS font family
  2977. 0    belong        0x137A2950    scalable OpenFont binary
  2978. 0    belong        0x137A2951    encrypted scalable OpenFont binary
  2979. 8    belong        0x137A2B45    X11/NeWS bitmap font
  2980. 8    belong        0x137A2B48    X11/NeWS font family
  2981. #
  2982. #    $NetBSD: os9,v 1.2 1997/01/09 20:19:04 tls Exp $
  2983. #
  2984. # Copyright (c) 1996 Ignatios Souvatzis. All rights reserved.
  2985. #
  2986. # Redistribution and use in source and binary forms, with or without
  2987. # modification, are permitted provided that the following conditions
  2988. # are met:
  2989. # 1. Redistributions of source code must retain the above copyright
  2990. #    notice, this list of conditions and the following disclaimer.
  2991. # 2. Redistributions in binary form must reproduce the above copyright
  2992. #    notice, this list of conditions and the following disclaimer in the
  2993. #    documentation and/or other materials provided with the distribution.
  2994. # 3. All advertising materials mentioning features or use of this software
  2995. #    must display the following acknowledgement:
  2996. #      This product includes software developed by Ignatios Souvatzis for
  2997. #      the NetBSD project.
  2998. # 4. The name of the author may not be used to endorse or promote products
  2999. #    derived from this software without specific prior written permission.
  3000. #
  3001. #
  3002. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  3003. # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  3004. # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  
  3005. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  3006. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  3007. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  3008. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  3009. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  3010. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  3011. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3012. #
  3013. #
  3014. #
  3015. # OS9/6809 module descriptions:
  3016. #
  3017. 0    beshort        0x87CD    OS9/6809 module:
  3018. #
  3019. >6    byte&0x0f    0x00    non-executable
  3020. >6    byte&0x0f    0x01    machine language
  3021. >6    byte&0x0f    0x02    BASIC I-code
  3022. >6    byte&0x0f    0x03    P-code
  3023. >6    byte&0x0f    0x04    C I-code
  3024. >6    byte&0x0f    0x05    COBOL I-code
  3025. >6    byte&0x0f    0x06    FORTRAN I-code
  3026. #
  3027. >6    byte&0xf0    0x10    program executable
  3028. >6    byte&0xf0    0x20    subroutine
  3029. >6    byte&0xf0    0x30    multi-module
  3030. >6    byte&0xf0    0x40    data module
  3031. #
  3032. >6    byte&0xf0    0xC0    system module
  3033. >6    byte&0xf0    0xD0    file manager
  3034. >6    byte&0xf0    0xE0    device driver
  3035. >6    byte&0xf0    0xF0    device descriptor
  3036. #
  3037. # OS9/m68k stuff (to be continued)
  3038. #
  3039. 0    beshort        0x4AFC    OS9/68K module:
  3040. #
  3041. # attr
  3042. >14    byte&0x80    0x80    re-entrant
  3043. >14    byte&0x40    0x40    ghost
  3044. >14    byte&0x20    0x20    system-state
  3045. #
  3046. # lang:
  3047. #
  3048. >13    byte        1    machine language
  3049. >13    byte        2    BASIC I-code
  3050. >13    byte        3    P-code
  3051. >13    byte        4    C I-code
  3052. >13    byte        5    COBOL I-code
  3053. >13    byte        6    Fortran I-code
  3054. #
  3055. #
  3056. # type:
  3057. #
  3058. >12    byte        1    program executable
  3059. >12    byte        2    subroutine
  3060. >12    byte        3    multi-module
  3061. >12    byte        4    data module
  3062. >12    byte        11    trap library
  3063. >12    byte        12    system module
  3064. >12    byte        13    file manager
  3065. >12    byte        14    device driver
  3066. >12    byte        15    device descriptor
  3067. #
  3068. # Mach magic number info
  3069. #
  3070. 0    long        0xefbe    OSF/Rose object
  3071. # I386 magic number info
  3072. #
  3073. 0    short        0565    i386 COFF object
  3074.  
  3075. #------------------------------------------------------------------------------
  3076. # pbm:  file(1) magic for Portable Bitmap files
  3077. #
  3078. # XXX - byte order?
  3079. #
  3080. 0    short    0x2a17    "compact bitmap" format (Poskanzer)
  3081. #------------------------------------------------------------------------------
  3082. # pdf:  file(1) magic for Portable Document Format
  3083. #
  3084.  
  3085. 0    string        %PDF-        PDF document
  3086. >5    byte        x        \b, version %c
  3087. >7    byte        x        \b.%c
  3088.  
  3089. #------------------------------------------------------------------------------
  3090. # pdp:  file(1) magic for PDP-11 executable/object and APL workspace
  3091. #
  3092. 0    lelong        0101555        PDP-11 single precision APL workspace
  3093. 0    lelong        0101554        PDP-11 double precision APL workspace
  3094. #
  3095. # PDP-11 a.out
  3096. #
  3097. 0    leshort        0407        PDP-11 executable
  3098. >8    leshort        >0        not stripped
  3099. >15    byte        >0        - version %ld
  3100.  
  3101. 0    leshort        0401        PDP-11 UNIX/RT ldp
  3102. 0    leshort        0405        PDP-11 old overlay
  3103.  
  3104. 0    leshort        0410        PDP-11 pure executable
  3105. >8    leshort        >0        not stripped
  3106. >15    byte        >0        - version %ld
  3107.  
  3108. 0    leshort        0411        PDP-11 separate I&D executable
  3109. >8    leshort        >0        not stripped
  3110. >15    byte        >0        - version %ld
  3111.  
  3112. 0    leshort        0437        PDP-11 kernel overlay
  3113.  
  3114. #------------------------------------------------------------------------------
  3115. # pgp:  file(1) magic for Pretty Good Privacy
  3116. #
  3117. 0       beshort         0x9900                  PGP key public ring
  3118. 0       beshort         0x9501                  PGP key security ring
  3119. 0       beshort         0x9500                  PGP key security ring
  3120. 0    beshort        0xa600            PGP encrypted data
  3121. 0       string          -----BEGIN\040PGP       PGP armored data
  3122. >15     string          PUBLIC\040KEY\040BLOCK- public key block
  3123. >15     string          MESSAGE-                message
  3124. >15     string          SIGNED\040MESSAGE-      signed message
  3125. >15     string          PGP\040SIGNATURE-       signature
  3126.  
  3127. #------------------------------------------------------------------------------
  3128. # pkgadd:  file(1) magic for SysV R4 PKG Datastreams
  3129. #
  3130. 0       string          #\ PaCkAgE\ DaTaStReAm  pkg Datastream (SVR4)
  3131.  
  3132. #------------------------------------------------------------------------------
  3133. # plus5:  file(1) magic for Plus Five's UNIX MUMPS
  3134. #
  3135. # XXX - byte order?  Paging Hokey....
  3136. #
  3137. 0    short        0x259        mumps avl global
  3138. >2    byte        >0        (V%d)
  3139. >6    byte        >0        with %d byte name
  3140. >7    byte        >0        and %d byte data cells
  3141. 0    short        0x25a        mumps blt global
  3142. >2    byte        >0        (V%d)
  3143. >8    short        >0        - %d byte blocks
  3144. >15    byte        0x00        - P/D format
  3145. >15    byte        0x01        - P/K/D format
  3146. >15    byte        0x02        - K/D format
  3147. >15    byte        >0x02        - Bad Flags
  3148.  
  3149. #------------------------------------------------------------------------------
  3150. # printer:  file(1) magic for printer-formatted files
  3151. #
  3152.  
  3153. # PostScript, updated by Daniel Quinlan (quinlan@yggdrasil.com)
  3154. 0    string        %!        PostScript document text
  3155. >2    string        PS-Adobe-    conforming
  3156. >>11    string        >\0        at level %.3s
  3157. >>>15    string        EPS        - type %s
  3158. >>>15    string        Query        - type %s
  3159. >>>15    string        ExitServer    - type %s
  3160. # Some PCs have the annoying habit of adding a ^D as a document separator
  3161. 0    string        \004%!        PostScript document text
  3162. >3    string        PS-Adobe-    conforming
  3163. >>12    string        >\0        at level %.3s
  3164. >>>16    string        EPS        - type %s
  3165. >>>16    string        Query        - type %s
  3166. >>>16    string        ExitServer    - type %s
  3167.  
  3168. # Adobe's PostScript Printer Description (PPD) files
  3169. #       Yves Arrouye <arrouye@marin.fdn.fr>
  3170. #
  3171. 0      string          *PPD-Adobe:    PPD file
  3172. >13    string          x              \b, ve
  3173.  
  3174. # HP Printer Job Language
  3175. 0    string        \033%-12345X@PJL    HP Printer Job Language data
  3176. # HP Printer Job Language
  3177. # The header found on Win95 HP plot files is the "Silliest Thing possible" 
  3178. # (TM)
  3179. # Every driver puts the language at some random position, with random case
  3180. # (LANGUAGE and Language)
  3181. # For example the LaserJet 5L driver puts the "PJL ENTER LANGUAGE" in line 10
  3182. # From: Uwe Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>
  3183. 0    string        \033%-12345X@PJL    HP Printer Job Language data
  3184. >&0    string        >\0            %s            
  3185. >>&0    string        >\0            %s            
  3186. >>>&0    string        >\0            %s        
  3187. >>>>&0    string        >\0            %s        
  3188. #>15    string        \ ENTER\ LANGUAGE\ =
  3189. #>31    string        PostScript        PostScript
  3190.  
  3191. # HP Printer Control Language, Daniel Quinlan (quinlan@yggdrasil.com)
  3192. 0    string        \033E\033    HP PCL printer data
  3193. >3    string        \&l0A        - default page size
  3194. >3    string        \&l1A        - US executive page size
  3195. >3    string        \&l2A        - US letter page size
  3196. >3    string        \&l3A        - US legal page size
  3197. >3    string        \&l26A        - A4 page size
  3198. >3    string        \&l80A        - Monarch envelope size
  3199. >3    string        \&l81A        - No. 10 envelope size
  3200. >3    string        \&l90A        - Intl. DL envelope size
  3201. >3    string        \&l91A        - Intl. C5 envelope size
  3202. >3    string        \&l100A        - Intl. B5 envelope size
  3203. >3    string        \&l-81A        - No. 10 envelope size (landscape)
  3204. >3    string        \&l-90A        - Intl. DL envelope size (landscape)
  3205.  
  3206. # IMAGEN printer-ready files:
  3207. 0    string    @document(        Imagen printer
  3208. # this only works if "language xxx" is first item in Imagen header.
  3209. >10    string    language\ impress    (imPRESS data)
  3210. >10    string    language\ daisy        (daisywheel text)
  3211. >10    string    language\ diablo    (daisywheel text)
  3212. >10    string    language\ printer    (line printer emulation)
  3213. >10    string    language\ tektronix    (Tektronix 4014 emulation)
  3214. # Add any other languages that your Imagen uses - remember
  3215. # to keep the word `text' if the file is human-readable.
  3216. # [GRR 950115:  missing "postscript" or "ultrascript" (whatever it was called)]
  3217. #
  3218. # Now magic for IMAGEN font files...
  3219. 0    string        Rast        RST-format raster font data
  3220. >45    string        >0        face %
  3221.  
  3222. #------------------------------------------------------------------------------
  3223. # psdbms:  file(1) magic for psdatabase
  3224. #
  3225. 0    belong&0xff00ffff    0x56000000    ps database
  3226. >1    string    >\0    version %s
  3227. >4    string    >\0    from kernel %s
  3228.  
  3229. #------------------------------------------------------------------------------
  3230. # pyramid:  file(1) magic for Pyramids
  3231. #
  3232. # XXX - byte order?
  3233. #
  3234. 0    long        0x50900107    Pyramid 90x family executable
  3235. 0    long        0x50900108    Pyramid 90x family pure executable
  3236. >16    long        >0        not stripped
  3237. 0    long        0x5090010b    Pyramid 90x family demand paged pure executable
  3238. >16    long        >0        not stripped
  3239. #------------------------------------------------------------------------------
  3240. #
  3241. # RPM: file(1) magic for Red Hat Packages   Erik Troan (ewt@redhat.com)
  3242. #
  3243. 0    beshort        0xedab        
  3244. >2    beshort        0xeedb        RPM
  3245. >>4    byte        x        v%d
  3246. >>6    beshort        0        bin
  3247. >>6    beshort        1        src
  3248. >>8    beshort        1        i386
  3249. >>8    beshort        2        Alpha
  3250. >>8    beshort        3        Sparc
  3251. >>8    beshort        4        MIPS
  3252. >>8    beshort        5        PowerPC
  3253. >>8    beshort        6        68000
  3254. >>8     beshort         7               SGI
  3255. >>10    string        x        %s
  3256.  
  3257. #------------------------------------------------------------------------------
  3258. # rtf:    file(1) magic for Rich Text Format (RTF)
  3259. #
  3260. # Duncan P. Simpson, D.P.Simpson@dcs.warwick.ac.uk
  3261. #
  3262. 0    string        {\\rtf        Rich Text Format data,
  3263. >5    byte        x        version %c,
  3264. >6    string        \\ansi        ANSI
  3265. >6    string        \\mac        Apple Macintosh
  3266. >6    string        \\pc        IBM PC, code page 437
  3267. >6    string        \\pca        IBM PS/2, code page 850
  3268.  
  3269. #------------------------------------------------------------------------------
  3270. # sc:  file(1) magic for "sc" spreadsheet
  3271. #
  3272. 38    string        Spreadsheet    sc spreadsheet file
  3273.  
  3274. #------------------------------------------------------------------------------
  3275. # sccs:  file(1) magic for SCCS archives
  3276. #
  3277. # SCCS archive structure:
  3278. # \001h01207
  3279. # \001s 00276/00000/00000
  3280. # \001d D 1.1 87/09/23 08:09:20 ian 1 0
  3281. # \001c date and time created 87/09/23 08:09:20 by ian
  3282. # \001e
  3283. # \001u
  3284. # \001U
  3285. # ... etc.
  3286. # Now '\001h' happens to be the same as the 3B20's a.out magic number (0550).
  3287. # *Sigh*. And these both came from various parts of the USG.
  3288. # Maybe we should just switch everybody from SCCS to RCS!
  3289. # Further, you can't just say '\001h0', because the five-digit number
  3290. # is a checksum that could (presumably) have any leading digit,
  3291. # and we don't have regular expression matching yet. 
  3292. # Hence the following official kludge:
  3293. 8    string        \001s\             SCCS archive data
  3294.  
  3295. #------------------------------------------------------------------------------
  3296. # sendmail:  file(1) magic for sendmail config files
  3297. #
  3298. # XXX - byte order?
  3299. #
  3300. 0    byte    046      Sendmail frozen configuration 
  3301. >16    string    >\0      - version %s
  3302. 0    short    0x271c      Sendmail frozen configuration
  3303. >16    string    >\0      - version %s
  3304.  
  3305. #------------------------------------------------------------------------------
  3306. # sequent:  file(1) magic for Sequent machines
  3307. #
  3308. # Sequent information updated by Don Dwiggins <atsun!dwiggins>.
  3309. # For Sequent's multiprocessor systems (incomplete).
  3310. 0    lelong    0x00ea            BALANCE NS32000 .o
  3311. >16    lelong    >0        not stripped
  3312. >124    lelong    >0        version %ld
  3313. 0    lelong    0x10ea            BALANCE NS32000 executable (0 @ 0)
  3314. >16    lelong  >0                not stripped
  3315. >124    lelong    >0        version %ld
  3316. 0    lelong    0x20ea            BALANCE NS32000 executable (invalid @ 0)
  3317. >16    lelong  >0                not stripped
  3318. >124    lelong    >0        version %ld
  3319. 0    lelong    0x30ea            BALANCE NS32000 standalone executable
  3320. >16    lelong  >0              not stripped
  3321. >124    lelong    >0        version %ld
  3322. #
  3323. # Symmetry information added by Jason Merrill <jason@jarthur.claremont.edu>.
  3324. # Symmetry magic nums will not be reached if DOS COM comes before them;
  3325. # byte 0xeb is matched before these get a chance.
  3326. 0    leshort    0x12eb        SYMMETRY i386 .o
  3327. >16    lelong    >0        not stripped
  3328. >124    lelong    >0        version %ld
  3329. 0    leshort    0x22eb        SYMMETRY i386 executable (0 @ 0)
  3330. >16    lelong    >0        not stripped
  3331. >124    lelong    >0        version %ld
  3332. 0    leshort    0x32eb        SYMMETRY i386 executable (invalid @ 0)
  3333. >16    lelong    >0        not stripped
  3334. >124    lelong    >0        version %ld
  3335. 0    leshort    0x42eb        SYMMETRY i386 standalone executable
  3336. >16    lelong    >0        not stripped
  3337. >124    lelong    >0        version %ld
  3338.  
  3339. #------------------------------------------------------------------------------
  3340. # sgi:  file(1) magic for Silicon Graphics (MIPS, IRIS, IRIX, etc.)
  3341. #                         Dec Ultrix (MIPS)
  3342. # all of SGI's *current* machines and OSes run in big-endian mode on the
  3343. # MIPS machines, as far as I know.
  3344. #
  3345. # XXX - what is the blank "-" line?
  3346. #
  3347. # kbd file definitions
  3348. 0    string    kbd!map        kbd map file
  3349. >8    byte    >0        Ver %d:
  3350. >10    short    >0        with %d table(s)
  3351. 0    belong    0407        old SGI 68020 executable
  3352. 0    belong    0410        old SGI 68020 pure executable
  3353. 0    beshort    0x8765        disk quotas file
  3354. 0    beshort    0x0506        IRIS Showcase file
  3355. >2    byte    0x49        -
  3356. >3    byte    x        - version %ld
  3357. 0    beshort    0x0226        IRIS Showcase template
  3358. >2    byte    0x63        -
  3359. >3    byte    x        - version %ld
  3360. 0    belong    0x5343464d    IRIS Showcase file
  3361. >4    byte    x        - version %ld
  3362. 0    belong    0x5443464d    IRIS Showcase template
  3363. >4    byte    x        - version %ld
  3364. 0    belong    0xdeadbabe    IRIX Parallel Arena
  3365. >8    belong    >0        - version %ld
  3366. #
  3367. 0    beshort    0x0160        MIPSEB COFF executable
  3368. >20    beshort    0407        (impure)
  3369. >20    beshort    0410        (swapped)
  3370. >20    beshort    0413        (paged)
  3371. >8    belong    >0        not stripped
  3372. >8    belong    0        stripped
  3373. >22    byte    x        - version %ld
  3374. >23    byte    x        .%ld
  3375. #
  3376. 0    beshort    0x0162        MIPSEL COFF executable
  3377. >20    beshort    0407        (impure)
  3378. >20    beshort    0410        (swapped)
  3379. >20    beshort    0413        (paged)
  3380. >8    belong    >0        not stripped
  3381. >8    belong    0        stripped
  3382. >23    byte    x        - version %d
  3383. >22    byte    x        .%ld
  3384. #
  3385. 0    beshort    0x6001        MIPSEB-LE COFF executable
  3386. >20    beshort    03401        (impure)
  3387. >20    beshort    04001        (swapped)
  3388. >20    beshort    05401        (paged)
  3389. >8    belong    >0        not stripped
  3390. >8    belong    0        stripped
  3391. >23    byte    x        - version %d
  3392. >22    byte    x        .%ld
  3393. #
  3394. 0    beshort    0x6201        MIPSEL-LE COFF executable
  3395. >20    beshort    03401        (impure)
  3396. >20    beshort    04001        (swapped)
  3397. >20    beshort    05401        (paged)
  3398. >8    belong    >0        not stripped
  3399. >8    belong    0        stripped
  3400. >23    byte    x        - version %ld
  3401. >22    byte    x        .%ld
  3402. #
  3403. # MIPS 2 additions
  3404. #
  3405. 0    beshort    0x0163        MIPSEB MIPS-II COFF executable
  3406. >20    beshort    0407        (impure)
  3407. >20    beshort    0410        (swapped)
  3408. >20    beshort    0413        (paged)
  3409. >8    belong    >0        not stripped
  3410. >8    belong    0        stripped
  3411. >22    byte    x        - version %ld
  3412. >23    byte    x        .%ld
  3413. #
  3414. 0    beshort    0x0166        MIPSEL MIPS-II COFF executable
  3415. >20    beshort    0407        (impure)
  3416. >20    beshort    0410        (swapped)
  3417. >20    beshort    0413        (paged)
  3418. >8    belong    >0        not stripped
  3419. >8    belong    0        stripped
  3420. >22    byte    x        - version %ld
  3421. >23    byte    x        .%ld
  3422. #
  3423. 0    beshort    0x6301        MIPSEB-LE MIPS-II COFF executable
  3424. >20    beshort    03401        (impure)
  3425. >20    beshort    04001        (swapped)
  3426. >20    beshort    05401        (paged)
  3427. >8    belong    >0        not stripped
  3428. >8    belong    0        stripped
  3429. >23    byte    x        - version %ld
  3430. >22    byte    x        .%ld
  3431. #
  3432. 0    beshort    0x6601        MIPSEL-LE MIPS-II COFF executable
  3433. >20    beshort    03401        (impure)
  3434. >20    beshort    04001        (swapped)
  3435. >20    beshort    05401        (paged)
  3436. >8    belong    >0        not stripped
  3437. >8    belong    0        stripped
  3438. >23    byte    x        - version %ld
  3439. >22    byte    x        .%ld
  3440. #
  3441. # MIPS 3 additions
  3442. #
  3443. 0    beshort    0x0140        MIPSEB MIPS-III COFF executable
  3444. >20    beshort    0407        (impure)
  3445. >20    beshort    0410        (swapped)
  3446. >20    beshort    0413        (paged)
  3447. >8    belong    >0        not stripped
  3448. >8    belong    0        stripped
  3449. >22    byte    x        - version %ld
  3450. >23    byte    x        .%ld
  3451. #
  3452. 0    beshort    0x0142        MIPSEL MIPS-III COFF executable
  3453. >20    beshort    0407        (impure)
  3454. >20    beshort    0410        (swapped)
  3455. >20    beshort    0413        (paged)
  3456. >8    belong    >0        not stripped
  3457. >8    belong    0        stripped
  3458. >22    byte    x        - version %ld
  3459. >23    byte    x        .%ld
  3460. #
  3461. 0    beshort    0x4001        MIPSEB-LE MIPS-III COFF executable
  3462. >20    beshort    03401        (impure)
  3463. >20    beshort    04001        (swapped)
  3464. >20    beshort    05401        (paged)
  3465. >8    belong    >0        not stripped
  3466. >8    belong    0        stripped
  3467. >23    byte    x        - version %ld
  3468. >22    byte    x        .%ld
  3469. #
  3470. 0    beshort    0x4201        MIPSEL-LE MIPS-III COFF executable
  3471. >20    beshort    03401        (impure)
  3472. >20    beshort    04001        (swapped)
  3473. >20    beshort    05401        (paged)
  3474. >8    belong    >0        not stripped
  3475. >8    belong    0        stripped
  3476. >23    byte    x        - version %ld
  3477. >22    byte    x        .%ld
  3478. #
  3479. 0    beshort    0x180        MIPSEB Ucode
  3480. 0    beshort    0x182        MIPSEL Ucode
  3481. # 32bit core file
  3482. 0    belong    0xdeadadb0    IRIX core dump
  3483. >4    belong    1        of
  3484. >16    string    >\0        '%s'
  3485. # 64bit core file
  3486. 0    belong    0xdeadad40    IRIX 64-bit core dump
  3487. >4    belong    1        of
  3488. >16    string    >\0        '%s'
  3489. # N32bit core file
  3490. 0       belong    0xbabec0bb    IRIX N32 core dump
  3491. >4      belong    1               of
  3492. >16     string    >\0             '%s'
  3493. # New style crash dump file
  3494. 0    string    \x43\x72\x73\x68\x44\x75\x6d\x70    IRIX vmcore dump of
  3495. >36    string    >\0                    '%s'
  3496. # Trusted IRIX info
  3497. 0    string    SGIAUDIT    SGI Audit file
  3498. >8    byte    x        - version %d
  3499. >9    byte    x        .%ld
  3500. #
  3501. 0    string    WNGZWZSC    Wingz compiled script
  3502. 0    string    WNGZWZSS    Wingz spreadsheet
  3503. 0    string    WNGZWZHP    Wingz help file
  3504. #
  3505. 0    string    \#Inventor V    IRIS Inventor 1.0 file
  3506. 0    string    \#Inventor V2    Open Inventor 2.0 file
  3507. # XXX - I don't know what next thing is!  It is likely to be an image
  3508. # (or movie) format
  3509. 0    string    glfHeadMagic();        GLF_TEXT
  3510. 4    belong    0x41010000        GLF_BINARY_LSB_FIRST
  3511. 4    belong    0x00000141        GLF_BINARY_MSB_FIRST
  3512.  
  3513. #------------------------------------------------------------------------------
  3514. # sgml:  file(1) magic for Standard Generalized Markup Language
  3515.  
  3516. # HyperText Markup Language (HTML) is an SGML document type,
  3517. # from Daniel Quinlan (quinlan@yggdrasil.com)
  3518. 0    string        \<!DOCTYPE\ HTML    HTML document text
  3519. 0    string        \<!doctype\ html    HTML document text
  3520. 0    string        \<HEAD        HTML document text
  3521. 0    string        \<head        HTML document text
  3522. 0    string        \<TITLE        HTML document text
  3523. 0    string        \<title        HTML document text
  3524. 0    string        \<html        HTML document text
  3525. 0    string        \<HTML        HTML document text
  3526.  
  3527. # SGML, mostly from rph@sq
  3528. 0    string        \<!DOCTYPE    exported SGML document text
  3529. 0    string        \<!doctype    exported SGML document text
  3530. 0    string        \<!SUBDOC    exported SGML subdocument text
  3531. 0    string        \<!subdoc    exported SGML subdocument text
  3532. 0    string        \<!--        exported SGML document text
  3533.  
  3534. #------------------------------------------------------------------------------
  3535. # sniffer:  file(1) magic for packet captured files
  3536. #
  3537. # From: guy@netapp.com (Guy Harris)
  3538. #
  3539. # Microsoft NetMon (packet capture/display program) capture files.
  3540. #
  3541. 0    string        RTSS        NetMon capture file
  3542. >4    byte        x        - version %d
  3543. >5    byte        x        \b.%d
  3544. >6    leshort        0        (Unknown)
  3545. >6    leshort        1        (Ethernet)
  3546. >6    leshort        2        (Token Ring)
  3547. >6    leshort        3        (FDDI)
  3548.  
  3549. #
  3550. # Network General Sniffer capture files.
  3551. #
  3552. 0    string        TRSNIFF\ data\ \ \ \ \032    Sniffer capture file
  3553. >23    leshort        x        - version %d
  3554. >25    leshort        x        \b.%d
  3555. >33    byte        x        (Format %d,
  3556. >32    byte        0        Token ring)
  3557. >32    byte        1        Ethernet)
  3558. >32    byte        2        ARCNET)
  3559. >32    byte        3        StarLAN)
  3560. >32    byte        4        PC Network broadband)
  3561. >32    byte        5        LocalTalk)
  3562. >32    byte        6        Znet)
  3563. #
  3564. # Cinco Networks NetXRay capture files.
  3565. #
  3566. 0    string        XCP\0        NetXRay capture file
  3567. >4    string        >\0        - version %s
  3568. #
  3569. # "libpcap" capture files.
  3570. # (We call them "tcpdump capture file(s)" for now, as "tcpdump" is
  3571. # the main program that uses that format, but there's also "tcpview",
  3572. # and there may be others in the future.)
  3573. #
  3574. 0    ubelong        0xa1b2c3d4    tcpdump capture file (big-endian)
  3575. >4    beshort        x        - version %d
  3576. >6    beshort        x        \b.%d
  3577. >20    belong        0        (No link-layer encapsulation
  3578. >20    belong        1        (Ethernet
  3579. >20    belong        2        (3Mb Ethernet
  3580. >20    belong        3        (AX.25
  3581. >20    belong        4        (ProNET
  3582. >20    belong        5        (CHAOS
  3583. >20    belong        6        (IEEE 802.x network
  3584. >20    belong        7        (ARCNET
  3585. >20    belong        8        (SLIP
  3586. >20    belong        9        (PPP
  3587. >20    belong        10        (FDDI
  3588. >20    belong        11        (RFC 1483 ATM
  3589. >20    belong        12        (raw IP
  3590. >20    belong        13        (BSD/OS SLIP
  3591. >20    belong        14        (BSD/OS PPP
  3592. >16    belong        x        \b, capture length %d)
  3593. 0    ulelong        0xa1b2c3d4    tcpdump capture file (little-endian)
  3594. >4    leshort        x        - version %d
  3595. >6    leshort        x        \b.%d
  3596. >20    lelong        0        (No link-layer encapsulation
  3597. >20    lelong        1        (Ethernet
  3598. >20    lelong        2        (3Mb Ethernet
  3599. >20    lelong        3        (AX.25
  3600. >20    lelong        4        (ProNET
  3601. >20    lelong        5        (CHAOS
  3602. >20    lelong        6        (IEEE 802.x network
  3603. >20    lelong        7        (ARCNET
  3604. >20    lelong        8        (SLIP
  3605. >20    lelong        9        (PPP
  3606. >20    lelong        10        (FDDI
  3607. >20    lelong        11        (RFC 1483 ATM
  3608. >20    lelong        12        (raw IP
  3609. >20    lelong        13        (BSD/OS SLIP
  3610. >20    lelong        14        (BSD/OS PPP
  3611. >16    lelong        x        \b, capture length %d)
  3612.  
  3613. #------------------------------------------------------------------------------
  3614. # softquad:  file(1) magic for SoftQuad Publishing Software
  3615. #
  3616. # $Id: softquad,v 1.9 1995/01/21 21:09:00 christos Exp $
  3617. # Author/Editor and RulesBuilder
  3618. #
  3619. # XXX - byte order?
  3620. #
  3621. 0    string        \<!SQ\ DTD>    Compiled SGML rules file
  3622. >9    string        >\0         Type %s
  3623. 0    string        \<!SQ\ A/E>    A/E SGML Document binary
  3624. >9    string        >\0         Type %s
  3625. 0    string        \<!SQ\ STS>    A/E SGML binary styles file
  3626. >9    string        >\0         Type %s
  3627. 0    short        0xc0de        Compiled PSI (v1) data
  3628. 0    short        0xc0da        Compiled PSI (v2) data
  3629. >3    string        >\0        (%s)
  3630. # Binary sqtroff font/desc files...
  3631. 0    short        0125252        SoftQuad DESC or font file binary
  3632. >2    short        >0        - version %d
  3633. # Bitmaps...
  3634. 0    string        SQ\ BITMAP1    SoftQuad Raster Format text
  3635. #0    string        SQ\ BITMAP2    SoftQuad Raster Format data
  3636. # sqtroff intermediate language (replacement for ditroff int. lang.)
  3637. 0    string        X\         SoftQuad troff Context intermediate
  3638. >2    string        495        for AT&T 495 laser printer
  3639. >2    string        hp        for Hewlett-Packard LaserJet
  3640. >2    string        impr        for IMAGEN imPRESS
  3641. >2    string        ps        for PostScript
  3642.  
  3643. #------------------------------------------------------------------------------
  3644. # sun:  file(1) magic for Sun machines
  3645. #
  3646. # Values for big-endian Sun (MC680x0, SPARC) binaries on pre-5.x
  3647. # releases.  (5.x uses ELF.)
  3648. #
  3649. 0    belong&077777777    0600413        sparc demand paged
  3650. >0    byte        &0x80
  3651. >>20    belong        <4096        shared library
  3652. >>20    belong        =4096        dynamically linked executable
  3653. >>20    belong        >4096        dynamically linked executable
  3654. >0    byte        ^0x80        executable
  3655. >16    belong        >0        not stripped
  3656. 0    belong&077777777    0600410        sparc pure
  3657. >0    byte        &0x80        dynamically linked executable
  3658. >0    byte        ^0x80        executable
  3659. >16    belong        >0        not stripped
  3660. 0    belong&077777777    0600407        sparc
  3661. >0    byte        &0x80        dynamically linked executable
  3662. >0    byte        ^0x80        executable
  3663. >16    belong        >0        not stripped
  3664.  
  3665. 0    belong&077777777    0400413        mc68020 demand paged
  3666. >0    byte        &0x80
  3667. >>20    belong        <4096        shared library
  3668. >>20    belong        =4096        dynamically linked executable
  3669. >>20    belong        >4096        dynamically linked executable
  3670. >16    belong        >0        not stripped
  3671. 0    belong&077777777    0400410        mc68020 pure
  3672. >0    byte        &0x80        dynamically linked executable
  3673. >0    byte        ^0x80        executable
  3674. >16    belong        >0        not stripped
  3675. 0    belong&077777777    0400407        mc68020
  3676. >0    byte        &0x80        dynamically linked executable
  3677. >0    byte        ^0x80        executable
  3678. >16    belong        >0        not stripped
  3679.  
  3680. 0    belong&077777777    0200413        mc68010 demand paged
  3681. >0    byte        &0x80
  3682. >>20    belong        <4096        shared library
  3683. >>20    belong        =4096        dynamically linked executable
  3684. >>20    belong        >4096        dynamically linked executable
  3685. >16    belong        >0        not stripped
  3686. 0    belong&077777777    0200410        mc68010 pure
  3687. >0    byte        &0x80        dynamically linked executable
  3688. >0    byte        ^0x80        executable
  3689. >16    belong        >0        not stripped
  3690. 0    belong&077777777    0200407        mc68010
  3691. >0    byte        &0x80        dynamically linked executable
  3692. >0    byte        ^0x80        executable
  3693. >16    belong        >0        not stripped
  3694.  
  3695. # reworked these to avoid anything beginning with zero becoming "old sun-2"
  3696. 0    belong        0407        old sun-2 executable
  3697. >16    belong        >0        not stripped
  3698. 0    belong        0410        old sun-2 pure executable
  3699. >16    belong        >0        not stripped
  3700. 0    belong        0413        old sun-2 demand paged executable
  3701. >16    belong        >0        not stripped
  3702.  
  3703. #
  3704. # Core files.  "SPARC 4.x BCP" means "core file from a SunOS 4.x SPARC
  3705. # binary executed in compatibility mode under SunOS 5.x".
  3706. #
  3707. 0    belong        0x080456    SunOS core file
  3708. >4    belong        432        (SPARC)
  3709. >>132    string        >\0        from '%s'
  3710. >>116    belong        =3        (quit)
  3711. >>116    belong        =4        (illegal instruction)
  3712. >>116    belong        =5        (trace trap)
  3713. >>116    belong        =6        (abort)
  3714. >>116    belong        =7        (emulator trap)
  3715. >>116    belong        =8        (arithmetic exception)
  3716. >>116    belong        =9        (kill)
  3717. >>116    belong        =10        (bus error)
  3718. >>116    belong        =11        (segmentation violation)
  3719. >>116    belong        =12        (bad argument to system call)
  3720. >>116    belong        =29        (resource lost)
  3721. >>120    belong        x        (T=%dK,
  3722. >>124    belong        x        D=%dK,
  3723. >>128    belong        x        S=%dK)
  3724. >4    belong        826        (68K)
  3725. >>128    string        >\0        from '%s'
  3726. >4    belong        456        (SPARC 4.x BCP)
  3727. >>152    string        >\0        from '%s'
  3728. # Sun SunPC
  3729. 0    long        0xfa33c08e    SunPC 4.0 Hard Disk
  3730. 0    string        #SUNPC_CONFIG    SunPC 4.0 Properties Values
  3731. # Sun snoop (see RFC 1761, which describes the capture file format).
  3732. #
  3733. 0    string        snoop        Snoop capture file
  3734. >8    belong        >0        - version %ld
  3735. >12    belong        0        (IEEE 802.3)
  3736. >12    belong        1        (IEEE 802.4)
  3737. >12    belong        2        (IEEE 802.5)
  3738. >12    belong        3        (IEEE 802.6)
  3739. >12    belong        4        (Ethernet)
  3740. >12    belong        5        (HDLC)
  3741. >12    belong        6        (Character synchronous)
  3742. >12    belong        7        (IBM channel-to-channel adapter)
  3743. >12    belong        8        (FDDI)
  3744. >12    belong        9        (Unknown)
  3745. # Sun KCMS
  3746. 36    string        acsp        Kodak Color Management System, ICC Profile
  3747.  
  3748.  
  3749.  
  3750. #------------------------------------------------------------------------------
  3751. # terminfo:  file(1) magic for terminfo
  3752. #
  3753. # XXX - byte order for screen images?
  3754. #
  3755. 0    string        \032\001    Compiled terminfo entry
  3756. 0    short        0433        Curses screen image
  3757. 0    short        0434        Curses screen image
  3758.  
  3759. #------------------------------------------------------------------------------
  3760. # tex:  file(1) magic for TeX files
  3761. #
  3762. # From <conklin@talisman.kaleida.com>
  3763.  
  3764. # Although we may know the offset of certain text fields in TeX DVI
  3765. # and font files, we can't use them reliably because they are not
  3766. # zero terminated. [but we do anyway, christos]
  3767. 0    string        \367\002    TeX DVI file
  3768. >16    string        >\0        (%s)
  3769. 0    string        \367\203    TeX generic font data
  3770. 0    string        \367\131    TeX packed font data
  3771. >3    string        >\0        (%s)
  3772. 0    string        \367\312    TeX virtual font data
  3773. 0    string        This\ is\ TeX,    TeX transcript text
  3774. 0    string        This\ is\ METAFONT,    METAFONT transcript text
  3775.  
  3776. # There is no way to detect TeX Font Metric (*.tfm) files without
  3777. # breaking them apart and reading the data.  The following patterns
  3778. # match most *.tfm files generated by METAFONT or afm2tfm.
  3779. 2    string        \000\021    TeX font metric data
  3780. >33    string        >\0        (%s)
  3781. 2    string        \000\022    TeX font metric data
  3782. >33    string        >\0        (%s)
  3783.  
  3784. # Texinfo and GNU Info, from Daniel Quinlan (quinlan@yggdrasil.com)
  3785. 0    string        \\input\ texinfo    Texinfo source text
  3786. 0    string        This\ is\ Info\ file    GNU Info text
  3787.  
  3788. # TeX documents, from Daniel Quinlan (quinlan@yggdrasil.com)
  3789. 0    string        \\input        TeX document text
  3790. 0    string        \\section    LaTeX document text
  3791. 0    string        \\setlength    LaTeX document text
  3792. 0    string        \\documentstyle    LaTeX document text
  3793. 0    string        \\chapter    LaTeX document text
  3794. # ------------------------------------------------------------------------
  3795. # ti-8x: file(1) magic for the TI-8x and TI-92 Graphing Calculators.
  3796. #
  3797. # From: Ryan McGuire (rmcguire@freenet.columbus.oh.us).
  3798. #
  3799. # NOTE: This list is not complete.
  3800. #
  3801. # Magic Numbers for the TI-82
  3802. #
  3803. 0               string          **TI82**        TI-82 Graphing Calculator
  3804. >0x000037       byte            0x0B            TI-BASIC Group/Program File.
  3805. #
  3806. # Magic Numbers for the TI-83
  3807. #
  3808. 0               string          **TI83**        TI-83 Graphing Calculator
  3809. >0x000037       byte            0x0B            TI-BASIC Group/Program File.
  3810. #
  3811. # Magic Numbers for the TI-85
  3812. #
  3813. 0               string          **TI85**        TI-85 Graphing Calculator
  3814. >11             string          Backup          Backup File.
  3815. >0x000032       string          ZS4             - ZShell Version 4 File.
  3816. >0x000032       string          ZS3             - ZShell Version 3 File.
  3817. >0x00000B       string          GDatabase       Graphics Database.
  3818. >0x00003B       byte            0x12            TI-BASIC Group/Program File.
  3819. #
  3820. # Magic Numbers for the TI-92
  3821. #
  3822. 0               string          **TI92**        TI-92 Graphing Calculator
  3823. >0x000058       byte            0x12            TI-BASIC Group File.
  3824. >0x000012       string          Function        Function.
  3825. >0x000048       byte            0x12            TI-BASIC Program.
  3826. # Files for the TI-80 and TI-81 are pretty rare. I'm not going to put the
  3827. # program/group magic numbers in here because I cannot find any.
  3828. 0               string          **TI80**        TI-80 Graphing Calculator File.
  3829. 0               string          **TI81**        TI-81 Graphing Calculator File.
  3830.  
  3831. #------------------------------------------------------------------------------
  3832. # timezone:  file(1) magic for timezone data
  3833. #
  3834. # from Daniel Quinlan (quinlan@yggdrasil.com)
  3835. # this should work on Linux, SunOS, and maybe others
  3836. # Added new official magic number for recent versions of the Olson code
  3837. 0    string    TZif    timezone data
  3838. 0    string    \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0    timezone data
  3839. 0    string    \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2\0    timezone data
  3840. 0    string  \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\3\0    timezone data
  3841. 0    string    \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0    timezone data
  3842. 0    string    \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0    timezone data
  3843. 0    string    \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\0    timezone data
  3844.  
  3845. #------------------------------------------------------------------------------
  3846. # troff:  file(1) magic for *roff
  3847. #
  3848. # updated by Daniel Quinlan (quinlan@yggdrasil.com)
  3849.  
  3850. # troff input
  3851. 0    string        .\\"        troff or preprocessor input text
  3852. 0    string        '\\"        troff or preprocessor input text
  3853. 0    string        '.\\"        troff or preprocessor input text
  3854. 0    string        \\"        troff or preprocessor input text
  3855.  
  3856. # ditroff intermediate output text
  3857. 0    string        x\ T        ditroff text
  3858. >4    string        cat        for the C/A/T phototypesetter
  3859. >4    string        ps        for PostScript
  3860. >4    string        dvi        for DVI
  3861. >4    string        ascii        for ASCII
  3862. >4    string        lj4        for LaserJet 4
  3863. >4    string        latin1        for ISO 8859-1 (Latin 1)
  3864. >4    string        X75        for xditview at 75dpi
  3865. >>7    string        -12        (12pt)
  3866. >4    string        X100        for xditview at 100dpi
  3867. >>8    string        -12        (12pt)
  3868.  
  3869. # output data formats
  3870. 0    string        \100\357    very old (C/A/T) troff output data
  3871.  
  3872. #------------------------------------------------------------------------------
  3873. # typeset:  file(1) magic for other typesetting
  3874. #
  3875. 0    string        Interpress/Xerox    Xerox InterPress data
  3876. >16    string        /            (version
  3877. >>17    string        >\0            %s)
  3878.  
  3879. #------------------------------------------------------------------------------
  3880. # unknown:  file(1) magic for unknown machines
  3881. #
  3882. # XXX - this probably should be pruned, as it'll match PDP-11 and
  3883. # VAX image formats.
  3884. #
  3885. # 0x107 is 0407; 0x108 is 0410; both are PDP-11 (executable and pure,
  3886. # respectively).
  3887. #
  3888. # 0x109 is 0411; that's PDP-11 split I&D, but the PDP-11 version doesn't
  3889. # have the "version %ld", which may be a bogus COFFism (I don't think
  3890. # there ever was COFF for the PDP-11).
  3891. #
  3892. # 0x10B is 0413; that's VAX demand-paged, but this is a short, not a
  3893. # long, as it would be on a VAX.
  3894. #
  3895. # 0x10C is 0414, 0x10D is 0415, and 0x10E is 416; those *are* unknown.
  3896. #
  3897. 0    short        0x107        unknown machine executable
  3898. >8    short        >0        not stripped
  3899. >15    byte        >0        - version %ld
  3900. 0    short        0x108        unknown pure executable
  3901. >8    short        >0        not stripped
  3902. >15    byte        >0        - version %ld
  3903. 0    short        0x109        PDP-11 separate I&D
  3904. >8    short        >0        not stripped
  3905. >15    byte        >0        - version %ld
  3906. 0    short        0x10b        unknown pure executable
  3907. >8    short        >0        not stripped
  3908. >15    byte        >0        - version %ld
  3909. 0    long        0x10c        unknown demand paged pure executable
  3910. >16    long        >0        not stripped
  3911. 0    long        0x10d        unknown demand paged pure executable
  3912. >16    long        >0        not stripped
  3913. 0    long        0x10e        unknown readable demand paged pure executable
  3914.  
  3915. #------------------------------------------------------------------------------
  3916. # uuencode:  file(1) magic for ASCII-encoded files
  3917. #
  3918.  
  3919. # GRR:  the first line of xxencoded files is identical to that in uuencoded
  3920. # files, but the first character in most subsequent lines is 'h' instead of
  3921. # 'M'.  (xxencoding uses lowercase letters in place of most of uuencode's
  3922. # punctuation and survives BITNET gateways better.)  If regular expressions
  3923. # were supported, this entry could possibly be split into two with
  3924. # "begin\040\.\*\012M" or "begin\040\.\*\012h" (where \. and \* are REs).
  3925. 0    string        begin\040    uuencoded or xxencoded text
  3926.  
  3927. # btoa(1) is an alternative to uuencode that requires less space.
  3928. 0    string        xbtoa\ Begin    btoa'd text
  3929.  
  3930. # ship(1) is another, much cooler alternative to uuencode.
  3931. # Greg Roelofs, newt@uchicago.edu
  3932. 0    string        $\012ship    ship'd binary text
  3933.  
  3934. # bencode(8) is used to encode compressed news batches (Bnews/Cnews only?)
  3935. # Greg Roelofs, newt@uchicago.edu
  3936. 0    string    Decode\ the\ following\ with\ bdeco    bencoded News text
  3937.  
  3938. # BinHex is the Macintosh ASCII-encoded file format (see also "apple")
  3939. # Daniel Quinlan, quinlan@yggdrasil.com
  3940. 11    string    must\ be\ converted\ with\ BinHex    BinHex binary text
  3941. >41    string    x                    \b, version %.3s
  3942.  
  3943. # GRR:  is MIME BASE64 encoding handled somewhere?
  3944.  
  3945. #------------------------------------------------------------------------------
  3946. # varied.out:  file(1) magic for various USG systems
  3947. #
  3948. #    Herewith many of the object file formats used by USG systems.
  3949. #    Most have been moved to files for a particular processor,
  3950. #    and deleted if they duplicate other entries.
  3951. #
  3952. 0    short        0610        Perkin-Elmer executable
  3953. # AMD 29K
  3954. 0    beshort        0572        amd 29k coff noprebar executable
  3955. 0    beshort        01572        amd 29k coff prebar executable
  3956. 0    beshort        0160007        amd 29k coff archive
  3957. # Cray
  3958. 6    beshort        0407        unicos (cray) executable
  3959. # Ultrix 4.3
  3960. 596    string        \130\337\377\377    Ultrix core file
  3961. >600    string        >\0    '%s'
  3962. # BeOS and MAcOS PEF executables
  3963. # From: hplus@zilker.net (Jon Watte)
  3964. 0    string        Joy!peffpwpc    header for PowerPC PEF executable
  3965.  
  3966. #------------------------------------------------------------------------------
  3967. # vax:  file(1) magic for VAX executable/object and APL workspace
  3968. #
  3969. 0    lelong        0101557        VAX single precision APL workspace
  3970. 0    lelong        0101556        VAX double precision APL workspace
  3971.  
  3972. #
  3973. # VAX a.out (32V, BSD)
  3974. #
  3975. 0    lelong        0407        VAX executable
  3976. >16    lelong        >0        not stripped
  3977.  
  3978. 0    lelong        0410        VAX pure executable
  3979. >16    lelong        >0        not stripped
  3980.  
  3981. 0    lelong        0413        VAX demand paged pure executable
  3982. >16    lelong        >0        not stripped
  3983.  
  3984. 0    lelong        0420        VAX demand paged (first page unmapped) pure executable
  3985. >16    lelong        >0        not stripped
  3986.  
  3987. #
  3988. # VAX COFF
  3989. #
  3990. # The `versions' should be un-commented if they work for you.
  3991. # (Was the problem just one of endianness?)
  3992. #
  3993. 0    leshort        0570        VAX COFF executable
  3994. >12    lelong        >0        not stripped
  3995. >22    leshort        >0        - version %ld
  3996. 0    leshort        0575        VAX COFF pure executable
  3997. >12    lelong        >0        not stripped
  3998. >22    leshort        >0        - version %ld
  3999. #
  4000. # Magic data for vgetty voice formats
  4001. # (Martin Seine & Marc Eberhard)
  4002. #
  4003.  
  4004. #
  4005. # raw modem data version 1
  4006. #
  4007.  
  4008. 0    string    RMD1      raw modem data
  4009. >4   string    >\0       (%s /
  4010. >20  short     >0        compression type 0x%04x)
  4011.  
  4012. #
  4013. # portable voice format 1
  4014. #
  4015.  
  4016. 0    string    PVF1\n         portable voice format
  4017. >5   string    >\0       (binary %s)
  4018.  
  4019. #
  4020. # portable voice format 2
  4021. #
  4022.  
  4023. 0    string    PVF2\n         portable voice format
  4024. >5   string >\0          (ascii %s)
  4025.  
  4026. #------------------------------------------------------------------------------
  4027. # visx:  file(1) magic for Visx format files
  4028. #
  4029. 0    short        0x5555        VISX image file
  4030. >2    byte        0        (zero)
  4031. >2    byte        1        (unsigned char)
  4032. >2    byte        2        (short integer)
  4033. >2    byte        3        (float 32)
  4034. >2    byte        4        (float 64)
  4035. >2    byte        5        (signed char)
  4036. >2    byte        6        (bit-plane)
  4037. >2    byte        7        (classes)
  4038. >2    byte        8        (statistics)
  4039. >2    byte        10        (ascii text)
  4040. >2    byte        15        (image segments)
  4041. >2    byte        100        (image set)
  4042. >2    byte        101        (unsigned char vector)
  4043. >2    byte        102        (short integer vector)
  4044. >2    byte        103        (float 32 vector)
  4045. >2    byte        104        (float 64 vector)
  4046. >2    byte        105        (signed char vector)
  4047. >2    byte        106        (bit plane vector)
  4048. >2    byte        121        (feature vector)
  4049. >2    byte        122        (feature vector library)
  4050. >2    byte        124        (chain code)
  4051. >2    byte        126        (bit vector)
  4052. >2    byte        130        (graph)
  4053. >2    byte        131        (adjacency graph)
  4054. >2    byte        132        (adjacency graph library)
  4055. >2    string        .VISIX        (ascii text)
  4056.  
  4057. #------------------------------------------------------------------------------
  4058. # vms:  file(1) magic for VMS executables (experimental)
  4059. #
  4060. # VMS .exe formats, both VAX and AXP (Greg Roelofs, newt@uchicago.edu)
  4061.  
  4062. # GRR 950122:  I'm just guessing on these, based on inspection of the headers
  4063. # of three executables each for Alpha and VAX architectures.  The VAX files
  4064. # all had headers similar to this:
  4065. #
  4066. #   00000  b0 00 30 00 44 00 60 00  00 00 00 00 30 32 30 35  ..0.D.`.....0205
  4067. #   00010  01 01 00 00 ff ff ff ff  ff ff ff ff 00 00 00 00  ................
  4068. #
  4069. 0    string    \xb0\0\x30\0    VMS VAX executable
  4070. >44032    string    PK\003\004    \b, Info-ZIP SFX archive v5.12 w/decryption
  4071. #
  4072. # The AXP files all looked like this, except that the byte at offset 0x22
  4073. # was 06 in some of them and 07 in others:
  4074. #
  4075. #   00000  03 00 00 00 00 00 00 00  ec 02 00 00 10 01 00 00  ................
  4076. #   00010  68 00 00 00 98 00 00 00  b8 00 00 00 00 00 00 00  h...............
  4077. #   00020  00 00 07 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
  4078. #   00030  00 00 00 00 01 00 00 00  00 00 00 00 00 00 00 00  ................
  4079. #   00040  00 00 00 00 ff ff ff ff  ff ff ff ff 02 00 00 00  ................
  4080. #
  4081. 0    belong    0x03000000    VMS Alpha executable
  4082. >75264    string    PK\003\004    \b, Info-ZIP SFX archive v5.12 w/decryption
  4083.  
  4084. #------------------------------------------------------------------------------
  4085. # xenix:  file(1) magic for Microsoft Xenix
  4086. #
  4087. # "Middle model" stuff, and "Xenix 8086 relocatable or 80286 small
  4088. # model" lifted from "magic.xenix", with comment "derived empirically;
  4089. # treat as folklore until proven"
  4090. #
  4091. # "small model", "large model", "huge model" stuff lifted from XXX
  4092. #
  4093. # XXX - "x.out" collides with PDP-11 archives
  4094. #
  4095. 0    string        core        core file (Xenix)
  4096. 0    byte        0x80        8086 relocatable (Microsoft)
  4097. 0    leshort        0xff65        x.out
  4098. >2    string        __.SYMDEF     randomized
  4099. >0    byte        x        archive
  4100. 0    leshort        0x206        Microsoft a.out
  4101. >8    leshort        1        Middle model
  4102. >0x1e    leshort        &0x10        overlay
  4103. >0x1e    leshort        &0x2        separate
  4104. >0x1e    leshort        &0x4        pure
  4105. >0x1e    leshort        &0x800        segmented
  4106. >0x1e    leshort        &0x400        standalone
  4107. >0x1e    leshort        &0x8        fixed-stack
  4108. >0x1c    byte        &0x80        byte-swapped
  4109. >0x1c    byte        &0x40        word-swapped
  4110. >0x10    lelong        >0        not-stripped
  4111. >0x1e    leshort        ^0xc000        pre-SysV
  4112. >0x1e    leshort        &0x4000        V2.3
  4113. >0x1e    leshort        &0x8000        V3.0
  4114. >0x1c    byte        &0x4        86
  4115. >0x1c    byte        &0xb        186
  4116. >0x1c    byte        &0x9        286
  4117. >0x1c    byte        &0xa        386
  4118. >0x1f    byte        <0x040        small model
  4119. >0x1f    byte        =0x048        large model    
  4120. >0x1f    byte        =0x049        huge model 
  4121. >0x1e    leshort        &0x1        executable
  4122. >0x1e    leshort        ^0x1        object file
  4123. >0x1e    leshort        &0x40        Large Text
  4124. >0x1e    leshort        &0x20        Large Data
  4125. >0x1e    leshort        &0x120        Huge Objects Enabled
  4126. >0x10    lelong        >0        not stripped
  4127.  
  4128. 0    leshort        0x140        old Microsoft 8086 x.out
  4129. >0x3    byte        &0x4        separate
  4130. >0x3    byte        &0x2        pure
  4131. >0    byte        &0x1        executable
  4132. >0    byte        ^0x1        relocatable
  4133. >0x14    lelong        >0        not stripped
  4134.  
  4135. 0    lelong        0x206        b.out
  4136. >0x1e    leshort        &0x10        overlay
  4137. >0x1e    leshort        &0x2        separate
  4138. >0x1e    leshort        &0x4        pure
  4139. >0x1e    leshort        &0x800        segmented
  4140. >0x1e    leshort        &0x400        standalone
  4141. >0x1e    leshort        &0x1        executable
  4142. >0x1e    leshort        ^0x1        object file
  4143. >0x1e    leshort        &0x4000        V2.3
  4144. >0x1e    leshort        &0x8000        V3.0
  4145. >0x1c    byte        &0x4        86
  4146. >0x1c    byte        &0xb        186
  4147. >0x1c    byte        &0x9        286
  4148. >0x1c    byte        &0x29        286
  4149. >0x1c    byte        &0xa        386
  4150. >0x1e    leshort        &0x4        Large Text
  4151. >0x1e    leshort        &0x2        Large Data
  4152. >0x1e    leshort        &0x102        Huge Objects Enabled
  4153.  
  4154. 0    leshort        0x580        XENIX 8086 relocatable or 80286 small model
  4155.  
  4156. #------------------------------------------------------------------------------
  4157. # zilog:  file(1) magic for Zilog Z8000.
  4158. #
  4159. # Was it big-endian or little-endian?  My Product Specification doesn't
  4160. # say.
  4161. #
  4162. 0    long        0xe807        object file (z8000 a.out)
  4163. 0    long        0xe808        pure object file (z8000 a.out)
  4164. 0    long        0xe809        separate object file (z8000 a.out)
  4165. 0    long        0xe805        overlay object file (z8000 a.out)
  4166.  
  4167. #------------------------------------------------------------------------------
  4168. # zyxel:  file(1) magic for ZyXEL modems
  4169. #
  4170. # From <rob@pe1chl.ampr.org>
  4171. # These are the /etc/magic entries to decode datafiles as used for the
  4172. # ZyXEL U-1496E DATA/FAX/VOICE modems.  (This header conforms to a
  4173. # ZyXEL-defined standard)
  4174.  
  4175. 0    string        ZyXEL\002    ZyXEL voice data
  4176. >10    byte        0        - CELP encoding
  4177. >10    byte&0x0B    1        - ADPCM2 encoding
  4178. >10    byte&0x0B    2        - ADPCM3 encoding
  4179. >10    byte&0x0B    3        - ADPCM4 encoding
  4180. >10    byte&0x0B    8        - New ADPCM3 encoding
  4181. >10    byte&0x04    4        with resync
  4182.